|
|
|
@ -53,56 +53,54 @@ |
|
|
|
|
* except that it is inverted. */ |
|
|
|
|
static av_cold void init_h263_dc_for_msmpeg4(void) |
|
|
|
|
{ |
|
|
|
|
int level, uni_code, uni_len; |
|
|
|
|
|
|
|
|
|
for(level=-256; level<256; level++){ |
|
|
|
|
int size, v, l; |
|
|
|
|
/* find number of bits */ |
|
|
|
|
size = 0; |
|
|
|
|
v = abs(level); |
|
|
|
|
while (v) { |
|
|
|
|
v >>= 1; |
|
|
|
|
size++; |
|
|
|
|
} |
|
|
|
|
for (int level = -256; level < 256; level++) { |
|
|
|
|
int uni_code, uni_len; |
|
|
|
|
int size, v, l; |
|
|
|
|
/* find number of bits */ |
|
|
|
|
size = 0; |
|
|
|
|
v = abs(level); |
|
|
|
|
while (v) { |
|
|
|
|
v >>= 1; |
|
|
|
|
size++; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (level < 0) |
|
|
|
|
l= (-level) ^ ((1 << size) - 1); |
|
|
|
|
else |
|
|
|
|
l= level; |
|
|
|
|
|
|
|
|
|
/* luminance H.263 */ |
|
|
|
|
uni_code= ff_mpeg4_DCtab_lum[size][0]; |
|
|
|
|
uni_len = ff_mpeg4_DCtab_lum[size][1]; |
|
|
|
|
uni_code ^= (1<<uni_len)-1; //M$ does not like compatibility
|
|
|
|
|
|
|
|
|
|
if (size > 0) { |
|
|
|
|
uni_code<<=size; uni_code|=l; |
|
|
|
|
uni_len+=size; |
|
|
|
|
if (size > 8){ |
|
|
|
|
uni_code<<=1; uni_code|=1; |
|
|
|
|
uni_len++; |
|
|
|
|
} |
|
|
|
|
if (level < 0) |
|
|
|
|
l = (-level) ^ ((1 << size) - 1); |
|
|
|
|
else |
|
|
|
|
l = level; |
|
|
|
|
|
|
|
|
|
/* luminance H.263 */ |
|
|
|
|
uni_code = ff_mpeg4_DCtab_lum[size][0]; |
|
|
|
|
uni_len = ff_mpeg4_DCtab_lum[size][1]; |
|
|
|
|
uni_code ^= (1 << uni_len) - 1; //M$ does not like compatibility
|
|
|
|
|
|
|
|
|
|
if (size > 0) { |
|
|
|
|
uni_code <<= size; uni_code |= l; |
|
|
|
|
uni_len += size; |
|
|
|
|
if (size > 8) { |
|
|
|
|
uni_code <<= 1; uni_code |= 1; |
|
|
|
|
uni_len++; |
|
|
|
|
} |
|
|
|
|
ff_v2_dc_lum_table[level + 256][0] = uni_code; |
|
|
|
|
ff_v2_dc_lum_table[level + 256][1] = uni_len; |
|
|
|
|
|
|
|
|
|
/* chrominance H.263 */ |
|
|
|
|
uni_code= ff_mpeg4_DCtab_chrom[size][0]; |
|
|
|
|
uni_len = ff_mpeg4_DCtab_chrom[size][1]; |
|
|
|
|
uni_code ^= (1<<uni_len)-1; //M$ does not like compatibility
|
|
|
|
|
|
|
|
|
|
if (size > 0) { |
|
|
|
|
uni_code<<=size; uni_code|=l; |
|
|
|
|
uni_len+=size; |
|
|
|
|
if (size > 8){ |
|
|
|
|
uni_code<<=1; uni_code|=1; |
|
|
|
|
uni_len++; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
ff_v2_dc_lum_table[level + 256][0] = uni_code; |
|
|
|
|
ff_v2_dc_lum_table[level + 256][1] = uni_len; |
|
|
|
|
|
|
|
|
|
/* chrominance H.263 */ |
|
|
|
|
uni_code = ff_mpeg4_DCtab_chrom[size][0]; |
|
|
|
|
uni_len = ff_mpeg4_DCtab_chrom[size][1]; |
|
|
|
|
uni_code ^= (1 << uni_len) - 1; //M$ does not like compatibility
|
|
|
|
|
|
|
|
|
|
if (size > 0) { |
|
|
|
|
uni_code <<= size; uni_code |= l; |
|
|
|
|
uni_len +=size; |
|
|
|
|
if (size > 8) { |
|
|
|
|
uni_code <<= 1; uni_code |= 1; |
|
|
|
|
uni_len++; |
|
|
|
|
} |
|
|
|
|
ff_v2_dc_chroma_table[level + 256][0] = uni_code; |
|
|
|
|
ff_v2_dc_chroma_table[level + 256][1] = uni_len; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
ff_v2_dc_chroma_table[level + 256][0] = uni_code; |
|
|
|
|
ff_v2_dc_chroma_table[level + 256][1] = uni_len; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
av_cold void ff_msmpeg4_common_init(MpegEncContext *s) |
|
|
|
|