[FFmpeg-devel] [PATCH] Electronic Arts TGQ decoder

Ramiro Polla ramiro.polla
Sat Sep 27 04:06:52 CEST 2008


On Fri, Sep 26, 2008 at 10:23 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Sat, Sep 27, 2008 at 10:12:34AM +1000, Peter Ross wrote:
>> Patches enclosed.
>>
>> Info: http://wiki.multimedia.cx/index.php?title=Electronic_Arts_TGQ
>> Samples: http://samples.mplayerhq.hu/game-formats/ea-tgq-uv/
>
> [...]
>> +const uint8_t ea_zigzag_scan[64]={
>> +   0,  8,  1,  2,  9, 16, 24, 17,
>> +  10,  3,  4, 11, 18, 25, 32, 40,
>> +  33, 26, 19, 12,  5,  6, 13, 20,
>> +  27, 34, 41, 48, 56, 49, 42, 35,
>> +  28, 21, 14,  7, 15, 22, 29, 36,
>> +  43, 50, 57, 58, 51, 44, 37, 30,
>> +  23, 31, 38, 45, 52, 59, 60, 53,
>> +  46, 39, 47, 54, 61, 62, 55, 63,
>> +};
>
> private non static things should have ff_ prefixes

This is ff_zigzag_direct transposed. I checked again against mimic's
zigzag and... huh??? Do you have any idea why mimic would have a
mostly transposed zigzag except for the last 10 coeffs? It starts
transposed and the last 10 coeffs are in direct order...

static const uint8_t col_zag[64] = {
     0,  8,  1,  2,  9, 16, 24, 17,
    10,  3,  4, 11, 18, 25, 32, 40,
    33, 26, 19, 12,  5,  6, 13, 20,
    27, 34, 41, 48, 56, 49, 42, 35,
    28, 21, 14,  7, 15, 22, 29, 36,
    43, 50, 57, 58, 51, 44, 37, 30,
    23, 31, 38, 45, 52, 59, 39, 46,
    53, 60, 61, 54, 47, 55, 62, 63,
};

I've checked again with the binary decoder, and this is correct. Could
this be intended, or maybe mimic's developers screwed up somewhere and
never noticed since most of the time the number of coeffs is hardcoded
to 28?

Ramiro Polla




More information about the ffmpeg-devel mailing list