[FFmpeg-devel] GSoC Qual VQA v3 : patch updated
Ronald S. Bultje
rsbultje
Mon Apr 13 20:37:31 CEST 2009
Hey,
On Mon, Apr 13, 2009 at 2:26 PM, The Deep Explorer
<thedeepexplorer at gmail.com> wrote:
>>> + ? ?while (src_index < src_size) {
>>> + ? ? ? ?memcpy(&code_buf, &src[src_index], 2);
>>> + ? ? ? ?code = code_buf >> 13;
>>
>> this code makes no sense.
>
> reading the two bytes , then shifting it right 13 bits so that I have
> the bits 15,14,13 in 2,1,0
>>
>>> + ? ? ? ?code = code & 0x0007;
>
> Then I am masking out the rest to get the code...
The outcome depends on endianness, and besides, you're probably
reading into an int (4-byte), which makes half of the bits undefined.
Do you understand the concept of endianness?
Depending on the encoding of the file (normally BE for bitstream
formats, I didn't read the wiki for VQA), you want to use something
like code = AV_RB16(&src[src_index]);. At least this makes the outcome
of the code identical on BE and LE CPUs.
Ronald
More information about the ffmpeg-devel
mailing list