diff options
author | Gagandeep Singh <deepgagan231197@gmail.com> | 2018-03-27 12:53:45 +0530 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2018-04-03 18:20:30 +0200 |
commit | 673604e0e3b7c7d6a077f61dee322d534ff6eae5 (patch) | |
tree | fbd499ae7d9b3e02478eafe9bb4484ab46705b5c | |
parent | d6fc031caf64eed921bbdef86d79d56bfc2633b0 (diff) | |
download | ffmpeg-673604e0e3b7c7d6a077f61dee322d534ff6eae5.tar.gz |
lavc/cfhd: fix distortion of lowest 8 lines when height is not multiple of 16
Also update fate reference. Fixes ticket #6675.
-rw-r--r-- | libavcodec/cfhd.c | 5 | ||||
-rw-r--r-- | tests/ref/fate/cfhd-3 | 20 |
2 files changed, 13 insertions, 12 deletions
diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c index e35732df45..f10742f4fa 100644 --- a/libavcodec/cfhd.c +++ b/libavcodec/cfhd.c @@ -213,13 +213,14 @@ static int alloc_buffers(AVCodecContext *avctx) int width = i ? avctx->width >> chroma_x_shift : avctx->width; int height = i ? avctx->height >> chroma_y_shift : avctx->height; ptrdiff_t stride = FFALIGN(width / 8, 8) * 8; - height = FFALIGN(height / 8, 2) * 8; + if (chroma_y_shift) + height = FFALIGN(height / 8, 2) * 8; s->plane[i].width = width; s->plane[i].height = height; s->plane[i].stride = stride; w8 = FFALIGN(s->plane[i].width / 8, 8); - h8 = FFALIGN(s->plane[i].height / 8, 2); + h8 = height / 8; w4 = w8 * 2; h4 = h8 * 2; w2 = w4 * 2; diff --git a/tests/ref/fate/cfhd-3 b/tests/ref/fate/cfhd-3 index 60e13c64a7..59fdc92260 100644 --- a/tests/ref/fate/cfhd-3 +++ b/tests/ref/fate/cfhd-3 @@ -3,13 +3,13 @@ #codec_id 0: rawvideo #dimensions 0: 496x241 #sar 0: 0/1 -0, 0, 0, 1, 478144, 0x6ed01dcd -0, 1, 1, 1, 478144, 0x6ed01dcd -0, 2, 2, 1, 478144, 0x6ed01dcd -0, 3, 3, 1, 478144, 0xb1b4a74b -0, 4, 4, 1, 478144, 0x94c345c3 -0, 5, 5, 1, 478144, 0x05e0388d -0, 6, 6, 1, 478144, 0xe747476a -0, 7, 7, 1, 478144, 0x8c1561f1 -0, 8, 8, 1, 478144, 0x8c1561f1 -0, 9, 9, 1, 478144, 0x8c1561f1 +0, 0, 0, 1, 478144, 0x48a01dbb +0, 1, 1, 1, 478144, 0x48a01dbb +0, 2, 2, 1, 478144, 0x48a01dbb +0, 3, 3, 1, 478144, 0xb978a72f +0, 4, 4, 1, 478144, 0x7bbb4679 +0, 5, 5, 1, 478144, 0xc3fd3f59 +0, 6, 6, 1, 478144, 0xfd2a4816 +0, 7, 7, 1, 478144, 0x207f65d3 +0, 8, 8, 1, 478144, 0x207f65d3 +0, 9, 9, 1, 478144, 0x207f65d3 |