|
|
|
@ -152,7 +152,6 @@ static inline int mpeg1_decode_block_inter(MpegEncContext *s, |
|
|
|
|
int16_t *block, int n) |
|
|
|
|
{ |
|
|
|
|
int level, i, j, run; |
|
|
|
|
RLTable *rl = &ff_rl_mpeg1; |
|
|
|
|
uint8_t *const scantable = s->intra_scantable.permutated; |
|
|
|
|
const uint16_t *quant_matrix = s->inter_matrix; |
|
|
|
|
const int qscale = s->qscale; |
|
|
|
@ -175,7 +174,7 @@ static inline int mpeg1_decode_block_inter(MpegEncContext *s, |
|
|
|
|
} |
|
|
|
|
/* now quantify & encode AC coefficients */ |
|
|
|
|
for (;;) { |
|
|
|
|
GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], |
|
|
|
|
GET_RL_VLC(level, run, re, &s->gb, ff_mpeg1_rl_vlc, |
|
|
|
|
TEX_VLC_BITS, 2, 0); |
|
|
|
|
|
|
|
|
|
if (level != 0) { |
|
|
|
@ -241,7 +240,6 @@ static inline int mpeg1_fast_decode_block_inter(MpegEncContext *s, |
|
|
|
|
int16_t *block, int n) |
|
|
|
|
{ |
|
|
|
|
int level, i, j, run; |
|
|
|
|
RLTable *rl = &ff_rl_mpeg1; |
|
|
|
|
uint8_t *const scantable = s->intra_scantable.permutated; |
|
|
|
|
const int qscale = s->qscale; |
|
|
|
|
|
|
|
|
@ -264,7 +262,7 @@ static inline int mpeg1_fast_decode_block_inter(MpegEncContext *s, |
|
|
|
|
|
|
|
|
|
/* now quantify & encode AC coefficients */ |
|
|
|
|
for (;;) { |
|
|
|
|
GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], |
|
|
|
|
GET_RL_VLC(level, run, re, &s->gb, ff_mpeg1_rl_vlc, |
|
|
|
|
TEX_VLC_BITS, 2, 0); |
|
|
|
|
|
|
|
|
|
if (level != 0) { |
|
|
|
@ -326,7 +324,6 @@ static inline int mpeg2_decode_block_non_intra(MpegEncContext *s, |
|
|
|
|
int16_t *block, int n) |
|
|
|
|
{ |
|
|
|
|
int level, i, j, run; |
|
|
|
|
RLTable *rl = &ff_rl_mpeg1; |
|
|
|
|
uint8_t *const scantable = s->intra_scantable.permutated; |
|
|
|
|
const uint16_t *quant_matrix; |
|
|
|
|
const int qscale = s->qscale; |
|
|
|
@ -358,7 +355,7 @@ static inline int mpeg2_decode_block_non_intra(MpegEncContext *s, |
|
|
|
|
|
|
|
|
|
/* now quantify & encode AC coefficients */ |
|
|
|
|
for (;;) { |
|
|
|
|
GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], |
|
|
|
|
GET_RL_VLC(level, run, re, &s->gb, ff_mpeg1_rl_vlc, |
|
|
|
|
TEX_VLC_BITS, 2, 0); |
|
|
|
|
|
|
|
|
|
if (level != 0) { |
|
|
|
@ -416,7 +413,6 @@ static inline int mpeg2_fast_decode_block_non_intra(MpegEncContext *s, |
|
|
|
|
int16_t *block, int n) |
|
|
|
|
{ |
|
|
|
|
int level, i, j, run; |
|
|
|
|
RLTable *rl = &ff_rl_mpeg1; |
|
|
|
|
uint8_t *const scantable = s->intra_scantable.permutated; |
|
|
|
|
const int qscale = s->qscale; |
|
|
|
|
OPEN_READER(re, &s->gb); |
|
|
|
@ -437,7 +433,7 @@ static inline int mpeg2_fast_decode_block_non_intra(MpegEncContext *s, |
|
|
|
|
|
|
|
|
|
/* now quantify & encode AC coefficients */ |
|
|
|
|
for (;;) { |
|
|
|
|
GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0); |
|
|
|
|
GET_RL_VLC(level, run, re, &s->gb, ff_mpeg1_rl_vlc, TEX_VLC_BITS, 2, 0); |
|
|
|
|
|
|
|
|
|
if (level != 0) { |
|
|
|
|
i += run; |
|
|
|
@ -489,7 +485,7 @@ static inline int mpeg2_decode_block_intra(MpegEncContext *s, |
|
|
|
|
{ |
|
|
|
|
int level, dc, diff, i, j, run; |
|
|
|
|
int component; |
|
|
|
|
RLTable *rl; |
|
|
|
|
const RL_VLC_ELEM *rl_vlc; |
|
|
|
|
uint8_t *const scantable = s->intra_scantable.permutated; |
|
|
|
|
const uint16_t *quant_matrix; |
|
|
|
|
const int qscale = s->qscale; |
|
|
|
@ -512,16 +508,16 @@ static inline int mpeg2_decode_block_intra(MpegEncContext *s, |
|
|
|
|
mismatch = block[0] ^ 1; |
|
|
|
|
i = 0; |
|
|
|
|
if (s->intra_vlc_format) |
|
|
|
|
rl = &ff_rl_mpeg2; |
|
|
|
|
rl_vlc = ff_mpeg2_rl_vlc; |
|
|
|
|
else |
|
|
|
|
rl = &ff_rl_mpeg1; |
|
|
|
|
rl_vlc = ff_mpeg1_rl_vlc; |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
OPEN_READER(re, &s->gb); |
|
|
|
|
/* now quantify & encode AC coefficients */ |
|
|
|
|
for (;;) { |
|
|
|
|
UPDATE_CACHE(re, &s->gb); |
|
|
|
|
GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], |
|
|
|
|
GET_RL_VLC(level, run, re, &s->gb, rl_vlc, |
|
|
|
|
TEX_VLC_BITS, 2, 0); |
|
|
|
|
|
|
|
|
|
if (level == 127) { |
|
|
|
@ -575,7 +571,7 @@ static inline int mpeg2_fast_decode_block_intra(MpegEncContext *s, |
|
|
|
|
{ |
|
|
|
|
int level, dc, diff, i, j, run; |
|
|
|
|
int component; |
|
|
|
|
RLTable *rl; |
|
|
|
|
const RL_VLC_ELEM *rl_vlc; |
|
|
|
|
uint8_t *const scantable = s->intra_scantable.permutated; |
|
|
|
|
const uint16_t *quant_matrix; |
|
|
|
|
const int qscale = s->qscale; |
|
|
|
@ -595,16 +591,16 @@ static inline int mpeg2_fast_decode_block_intra(MpegEncContext *s, |
|
|
|
|
block[0] = dc * (1 << (3 - s->intra_dc_precision)); |
|
|
|
|
i = 0; |
|
|
|
|
if (s->intra_vlc_format) |
|
|
|
|
rl = &ff_rl_mpeg2; |
|
|
|
|
rl_vlc = ff_mpeg2_rl_vlc; |
|
|
|
|
else |
|
|
|
|
rl = &ff_rl_mpeg1; |
|
|
|
|
rl_vlc = ff_mpeg1_rl_vlc; |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
OPEN_READER(re, &s->gb); |
|
|
|
|
/* now quantify & encode AC coefficients */ |
|
|
|
|
for (;;) { |
|
|
|
|
UPDATE_CACHE(re, &s->gb); |
|
|
|
|
GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], |
|
|
|
|
GET_RL_VLC(level, run, re, &s->gb, rl_vlc, |
|
|
|
|
TEX_VLC_BITS, 2, 0); |
|
|
|
|
|
|
|
|
|
if (level >= 64 || i > 63) { |
|
|
|
|