Patent ID: 8462702

Claim:
A method for encoding an audio or video signal having a base layer bit stream and an enhancement layer bit stream relating to the base layer bit stream, wherein the base layer data and the enhancement layer data are structured in packets, and wherein packets of the base layer bit stream have corresponding packets of the enhancement layer bit stream, the method comprising steps of: calculating a checksum over a packet of the base layer bit stream and a corresponding packet of the enhancement layer bit stream; entropy encoding the packet of the base layer bit stream, wherein an entropy encoded, byte-aligned base layer packet starting with a sync word is obtained; entropy encoding the packet of the enhancement layer bit stream using a variable length encoding method, wherein an entropy encoded enhancement layer packet is obtained that has no header and does not start with a sync word; mapping the encoded enhancement layer packet to bytes, each byte having a fixed number of bits, wherein in the last byte of the encoded enhancement layer packet a number N of bits are padding bits; determining the amount N of the padding bits within the last byte of the encoded enhancement layer packet; extracting the N least significant bits of said calculated checksum, N being equal to the determined amount of padding bits; inserting the extracted N least significant bits of the calculated checksum into the padding bits at the end of the encoded packet; and providing or outputting the encoded enhancement layer packet including the inserted checksum bits, and the encoded base layer packet.