[Ffmpeg-devel] h264 tc0_table usage

Loren Merritt lorenm
Sun Oct 15 23:51:54 CEST 2006


On Sun, 15 Oct 2006, Luca Barbato wrote:

> the tables are int
>
> libavcodec/h264data.h
> static const int tc0_table[52][3] = {
> static const int alpha_table[52] = {
> static const int beta_table[52] = {

regardless of the usage, the tables could be stored as int8_t if the 
reduced cache footprint helps.

> But sometimes they are used as uint8_t sometimes as int.
>
> libavcodec/h264.c
>        int8_t tc[4];
>        int8_t tc[4];
>        int8_t tc[4];
>        int8_t tc[4];

this case needs to be int8_t because they're used in mmx code that wants 
all the entries in one register.

> libavcodec/h264.c
>            const int tc0 = tc0_table[index_a][bS[bS_index] - 1];
>                int tc = tc0;
>            const int tc = tc0_table[index_a][bS[bS_index] - 1] + 1;

and this case uses int because scalar math is faster on int than on 
int8_t.

--Loren Merritt




More information about the ffmpeg-devel mailing list