diff mbox

[FFmpeg-devel] avcodec/vc1: fix check for missing CBPTAB

Message ID fe233deb-fb87-642a-7048-bb5ed0a69a9c@carpalis.nl
State Accepted
Commit efde2a70ffe6d8f5b53d0d1ea9c9c54fe9d979d4
Headers show

Commit Message

Jerome Borsboom June 20, 2018, 1:17 p.m. UTC
CBPTAB must be present in (non skipped) P and B pictures.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
---
This patch set should fix decoding of the SA10135.vc1 test file to make it
bit-equal to the reference decoder.

 libavcodec/vc1dec.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Carl Eugen Hoyos June 28, 2018, 11:30 p.m. UTC | #1
2018-06-20 15:17 GMT+02:00, Jerome Borsboom <jerome.borsboom@carpalis.nl>:
> CBPTAB must be present in (non skipped) P and B pictures.
>
> Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
> ---
> This patch set should fix decoding of the SA10135.vc1 test file to make it
> bit-equal to the reference decoder.

Patch applied.

Carl Eugen
diff mbox

Patch

diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index fdbc852ec2..9519864c55 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -1088,7 +1088,9 @@  static int vc1_decode_frame(AVCodecContext *avctx, void *data,
                 av_log(v->s.avctx, AV_LOG_ERROR, "end mb y %d %d invalid\n", s->end_mb_y, s->start_mb_y);
                 continue;
             }
-            if (!v->p_frame_skipped && s->pict_type != AV_PICTURE_TYPE_I && !v->cbpcy_vlc) {
+            if (((s->pict_type == AV_PICTURE_TYPE_P && !v->p_frame_skipped) ||
+                 (s->pict_type == AV_PICTURE_TYPE_B && !v->bi_type)) &&
+                !v->cbpcy_vlc) {
                 av_log(v->s.avctx, AV_LOG_ERROR, "missing cbpcy_vlc\n");
                 continue;
             }