mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-29 22:00:58 +02:00
avcodec/mpeg12dec: add support for MPEG1 blocks in IPU codec
This commit is contained in:
parent
2f9a3215aa
commit
c668294e8b
@ -3010,7 +3010,6 @@ static int ipu_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
s->flags = get_bits(gb, 8);
|
s->flags = get_bits(gb, 8);
|
||||||
if (!(s->flags & 0x80)) {
|
|
||||||
m->intra_dc_precision = s->flags & 3;
|
m->intra_dc_precision = s->flags & 3;
|
||||||
m->q_scale_type = !!(s->flags & 0x40);
|
m->q_scale_type = !!(s->flags & 0x40);
|
||||||
m->intra_vlc_format = !!(s->flags & 0x20);
|
m->intra_vlc_format = !!(s->flags & 0x20);
|
||||||
@ -3025,7 +3024,6 @@ static int ipu_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
}
|
}
|
||||||
|
|
||||||
m->last_dc[0] = m->last_dc[1] = m->last_dc[2] = 1 << (7 + (s->flags & 3));
|
m->last_dc[0] = m->last_dc[1] = m->last_dc[2] = 1 << (7 + (s->flags & 3));
|
||||||
}
|
|
||||||
m->qscale = 1;
|
m->qscale = 1;
|
||||||
|
|
||||||
for (int y = 0; y < avctx->height; y += 16) {
|
for (int y = 0; y < avctx->height; y += 16) {
|
||||||
@ -3053,10 +3051,24 @@ static int ipu_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
memset(s->block, 0, sizeof(s->block));
|
memset(s->block, 0, sizeof(s->block));
|
||||||
|
|
||||||
for (int n = 0; n < 6; n++) {
|
for (int n = 0; n < 6; n++) {
|
||||||
|
if (s->flags & 0x80) {
|
||||||
|
if (s->flags & 0x20)
|
||||||
|
ret = mpeg1_decode_block_inter(m, s->block[n], n);
|
||||||
|
else
|
||||||
|
ret = ff_mpeg1_decode_block_intra(&m->gb,
|
||||||
|
m->intra_matrix,
|
||||||
|
m->intra_scantable.permutated,
|
||||||
|
m->last_dc, s->block[n],
|
||||||
|
n, m->qscale);
|
||||||
|
if (ret >= 0)
|
||||||
|
m->block_last_index[n] = ret;
|
||||||
|
} else {
|
||||||
if (s->flags & 0x20)
|
if (s->flags & 0x20)
|
||||||
ret = mpeg2_decode_block_intra(m, s->block[n], n);
|
ret = mpeg2_decode_block_intra(m, s->block[n], n);
|
||||||
else
|
else
|
||||||
ret = mpeg2_decode_block_non_intra(m, s->block[n], n);
|
ret = mpeg2_decode_block_non_intra(m, s->block[n], n);
|
||||||
|
}
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user