diff --git a/libavfilter/vsrc_testsrc.c b/libavfilter/vsrc_testsrc.c index b97674403a..bedb16c647 100644 --- a/libavfilter/vsrc_testsrc.c +++ b/libavfilter/vsrc_testsrc.c @@ -1162,7 +1162,6 @@ static void yuvtest_put_pixel(uint8_t *dstp[4], int dst_linesizep[4], uint8_t ayuv_map[4]) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(fmt); - int shift = 0; uint32_t n; switch (fmt) { @@ -1175,17 +1174,15 @@ static void yuvtest_put_pixel(uint8_t *dstp[4], int dst_linesizep[4], n = (y << ((desc->comp[0].offset*8) + desc->comp[0].shift)) + (u << ((desc->comp[1].offset*8) + desc->comp[1].shift)) + (v << ((desc->comp[2].offset*8) + desc->comp[2].shift)) + - (3U << (desc->comp[1].shift ? 0 : 30)); + (3U << ((desc->comp[3].offset*8) + desc->comp[3].shift)); AV_WL32(&dstp[0][i*4 + j*dst_linesizep[0]], n); break; case AV_PIX_FMT_XV36: - shift = 4; // hardcoded as the alpha component in the descriptor has no values we can use - // fall-through case AV_PIX_FMT_AYUV64: AV_WN16(&dstp[0][i*8 + ayuv_map[Y]*2 + j*dst_linesizep[0]], y << desc->comp[0].shift); AV_WN16(&dstp[0][i*8 + ayuv_map[U]*2 + j*dst_linesizep[0]], u << desc->comp[1].shift); AV_WN16(&dstp[0][i*8 + ayuv_map[V]*2 + j*dst_linesizep[0]], v << desc->comp[2].shift); - AV_WN16(&dstp[0][i*8 + ayuv_map[A]*2 + j*dst_linesizep[0]], UINT16_MAX << shift); + AV_WN16(&dstp[0][i*8 + ayuv_map[A]*2 + j*dst_linesizep[0]], UINT16_MAX << desc->comp[3].shift); break; case AV_PIX_FMT_UYVA: case AV_PIX_FMT_VUYA: diff --git a/tests/fate/filter-video.mak b/tests/fate/filter-video.mak index 24feb70fe8..fbbc6d43b2 100644 --- a/tests/fate/filter-video.mak +++ b/tests/fate/filter-video.mak @@ -115,12 +115,18 @@ fate-filter-yuvtestsrc-yuv444p12: CMD = framecrc -lavfi yuvtestsrc=rate=5:durati FATE_FILTER-$(call FILTERFRAMECRC, YUVTESTSRC) += fate-filter-yuvtestsrc-ayuv fate-filter-yuvtestsrc-ayuv: CMD = framecrc -lavfi yuvtestsrc=rate=5:duration=1 -pix_fmt ayuv +FATE_FILTER-$(call FILTERFRAMECRC, YUVTESTSRC SCALE) += fate-filter-yuvtestsrc-ayuv64 +fate-filter-yuvtestsrc-ayuv64: CMD = framecrc -lavfi yuvtestsrc=rate=5:duration=1,format=ayuv64,scale -pix_fmt ayuv64le + FATE_FILTER-$(call FILTERFRAMECRC, YUVTESTSRC) += fate-filter-yuvtestsrc-vuya fate-filter-yuvtestsrc-vuya: CMD = framecrc -lavfi yuvtestsrc=rate=5:duration=1 -pix_fmt vuya FATE_FILTER-$(call FILTERFRAMECRC, YUVTESTSRC) += fate-filter-yuvtestsrc-vyu444 fate-filter-yuvtestsrc-vyu444: CMD = framecrc -lavfi yuvtestsrc=rate=5:duration=1 -pix_fmt vyu444 +FATE_FILTER-$(call FILTERFRAMECRC, YUVTESTSRC) += fate-filter-yuvtestsrc-v30xle +fate-filter-yuvtestsrc-v30xle: CMD = framecrc -lavfi yuvtestsrc=rate=5:duration=1 -pix_fmt v30xle + FATE_FILTER-$(call FILTERFRAMECRC, YUVTESTSRC) += fate-filter-yuvtestsrc-xv30le fate-filter-yuvtestsrc-xv30le: CMD = framecrc -lavfi yuvtestsrc=rate=5:duration=1 -pix_fmt xv30le diff --git a/tests/ref/fate/filter-yuvtestsrc-ayuv64 b/tests/ref/fate/filter-yuvtestsrc-ayuv64 new file mode 100644 index 0000000000..942ad1a1ba --- /dev/null +++ b/tests/ref/fate/filter-yuvtestsrc-ayuv64 @@ -0,0 +1,10 @@ +#tb 0: 1/5 +#media_type 0: video +#codec_id 0: rawvideo +#dimensions 0: 320x240 +#sar 0: 1/1 +0, 0, 0, 1, 614400, 0xcf4f8452 +0, 1, 1, 1, 614400, 0xcf4f8452 +0, 2, 2, 1, 614400, 0xcf4f8452 +0, 3, 3, 1, 614400, 0xcf4f8452 +0, 4, 4, 1, 614400, 0xcf4f8452 diff --git a/tests/ref/fate/filter-yuvtestsrc-v30xle b/tests/ref/fate/filter-yuvtestsrc-v30xle new file mode 100644 index 0000000000..bac805079c --- /dev/null +++ b/tests/ref/fate/filter-yuvtestsrc-v30xle @@ -0,0 +1,10 @@ +#tb 0: 1/5 +#media_type 0: video +#codec_id 0: rawvideo +#dimensions 0: 320x240 +#sar 0: 1/1 +0, 0, 0, 1, 307200, 0x9b712266 +0, 1, 1, 1, 307200, 0x9b712266 +0, 2, 2, 1, 307200, 0x9b712266 +0, 3, 3, 1, 307200, 0x9b712266 +0, 4, 4, 1, 307200, 0x9b712266