From: "Ronald S. Bultje" <rsbul...@gmail.com> --- libavcodec/wmv2enc.c | 4 ++++ tests/fate-run.sh | 3 ++- tests/fate/vcodec.mak | 5 +++-- tests/ref/seek/vsynth2-wmv2 | 28 ++++++++++++++-------------- tests/ref/vsynth/vsynth1-wmv2 | 8 ++++---- tests/ref/vsynth/vsynth2-wmv2 | 6 +++--- 6 files changed, 30 insertions(+), 24 deletions(-)
diff --git a/libavcodec/wmv2enc.c b/libavcodec/wmv2enc.c index 4643835..ee6136b 100644 --- a/libavcodec/wmv2enc.c +++ b/libavcodec/wmv2enc.c @@ -55,6 +55,10 @@ static int encode_ext_header(Wmv2Context *w){ static av_cold int wmv2_encode_init(AVCodecContext *avctx){ Wmv2Context * const w= avctx->priv_data; + if(avctx->idct_algo==FF_IDCT_AUTO){ + avctx->idct_algo=FF_IDCT_WMV2; + } + if(ff_MPV_encode_init(avctx) < 0) return -1; diff --git a/tests/fate-run.sh b/tests/fate-run.sh index d1633e8..9c23b67 100755 --- a/tests/fate-run.sh +++ b/tests/fate-run.sh @@ -128,6 +128,7 @@ enc_dec(){ enc_opt=$4 dec_fmt=$5 dec_opt=$6 + ddc_opt=$8 encfile="${outdir}/${test}.${enc_fmt}" decfile="${outdir}/${test}.out.${dec_fmt}" cleanfiles="$cleanfiles $decfile" @@ -139,7 +140,7 @@ enc_dec(){ -f $enc_fmt -y $tencfile || return do_md5sum $encfile echo $(wc -c $encfile) - avconv $DEC_OPTS -i $tencfile $ENC_OPTS $dec_opt $FLAGS \ + avconv $DEC_OPTS $ddc_opt -i $tencfile $ENC_OPTS $dec_opt $FLAGS \ -f $dec_fmt -y $tdecfile || return do_md5sum $decfile tests/tiny_psnr $srcfile $decfile $cmp_unit $cmp_shift diff --git a/tests/fate/vcodec.mak b/tests/fate/vcodec.mak index 5a5b703..cc33010 100644 --- a/tests/fate/vcodec.mak +++ b/tests/fate/vcodec.mak @@ -2,7 +2,7 @@ fate-vsynth1-%: SRC = tests/data/vsynth1.yuv fate-vsynth2-%: SRC = tests/data/vsynth2.yuv fate-vsynth%: CODEC = $(word 3, $(subst -, ,$(@))) fate-vsynth%: FMT = avi -fate-vsynth%: CMD = enc_dec "rawvideo -s 352x288 -pix_fmt yuv420p" $(SRC) $(FMT) "-c $(CODEC) $(ENCOPTS)" rawvideo "-s 352x288 -pix_fmt yuv420p $(DECOPTS)" -keep +fate-vsynth%: CMD = enc_dec "rawvideo -s 352x288 -pix_fmt yuv420p" $(SRC) $(FMT) "-c $(CODEC) $(ENCOPTS)" rawvideo "-s 352x288 -pix_fmt yuv420p $(DECOPTS)" -keep "$(DDCOPTS)" fate-vsynth%: CMP_UNIT = 1 fate-vsynth%: REF = $(SRC_PATH)/tests/ref/vsynth/$(@:fate-%=%) @@ -218,7 +218,8 @@ FATE_VCODEC-$(call ENCDEC, WMV1, AVI) += wmv1 fate-vsynth%-wmv1: ENCOPTS = -qscale 10 FATE_VCODEC-$(call ENCDEC, WMV2, AVI) += wmv2 -fate-vsynth%-wmv2: ENCOPTS = -qscale 10 +fate-vsynth%-wmv2: DDCOPTS = -idct auto +fate-vsynth%-wmv2: ENCOPTS = -qscale 10 -idct auto FATE_VCODEC-$(call ENCDEC, RAWVIDEO, AVI) += yuv fate-vsynth%-yuv: CODEC = rawvideo diff --git a/tests/ref/seek/vsynth2-wmv2 b/tests/ref/seek/vsynth2-wmv2 index 8ed257e..53680d0 100644 --- a/tests/ref/seek/vsynth2-wmv2 +++ b/tests/ref/seek/vsynth2-wmv2 @@ -2,45 +2,45 @@ ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5652 size: 8917 ret: 0 st:-1 flags:0 ts:-1.000000 ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5652 size: 8917 ret: 0 st:-1 flags:1 ts: 1.894167 -ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83790 size: 11170 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83764 size: 11170 ret: 0 st: 0 flags:0 ts: 0.800000 -ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 54572 size: 9989 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 54534 size: 9989 ret:-1 st: 0 flags:1 ts:-0.320000 ret:-1 st:-1 flags:0 ts: 2.576668 ret: 0 st:-1 flags:1 ts: 1.470835 -ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83790 size: 11170 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83764 size: 11170 ret: 0 st: 0 flags:0 ts: 0.360000 -ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 29632 size: 8839 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 29588 size: 8839 ret:-1 st: 0 flags:1 ts:-0.760000 ret:-1 st:-1 flags:0 ts: 2.153336 ret: 0 st:-1 flags:1 ts: 1.047503 -ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 54572 size: 9989 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 54534 size: 9989 ret: 0 st: 0 flags:0 ts:-0.040000 ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5652 size: 8917 ret: 0 st: 0 flags:1 ts: 2.840000 -ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116058 size: 11554 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116062 size: 11554 ret: 0 st:-1 flags:0 ts: 1.730004 -ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116058 size: 11554 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116062 size: 11554 ret: 0 st:-1 flags:1 ts: 0.624171 -ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 29632 size: 8839 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 29588 size: 8839 ret: 0 st: 0 flags:0 ts:-0.480000 ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5652 size: 8917 ret: 0 st: 0 flags:1 ts: 2.400000 -ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116058 size: 11554 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116062 size: 11554 ret: 0 st:-1 flags:0 ts: 1.306672 -ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83790 size: 11170 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83764 size: 11170 ret: 0 st:-1 flags:1 ts: 0.200839 ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5652 size: 8917 ret: 0 st: 0 flags:0 ts:-0.920000 ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5652 size: 8917 ret: 0 st: 0 flags:1 ts: 2.000000 -ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116058 size: 11554 +ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 116062 size: 11554 ret: 0 st:-1 flags:0 ts: 0.883340 -ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 54572 size: 9989 +ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 54534 size: 9989 ret:-1 st:-1 flags:1 ts:-0.222493 ret:-1 st: 0 flags:0 ts: 2.680000 ret: 0 st: 0 flags:1 ts: 1.560000 -ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83790 size: 11170 +ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 83764 size: 11170 ret: 0 st:-1 flags:0 ts: 0.460008 -ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 29632 size: 8839 +ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 29588 size: 8839 ret:-1 st:-1 flags:1 ts:-0.645825 diff --git a/tests/ref/vsynth/vsynth1-wmv2 b/tests/ref/vsynth/vsynth1-wmv2 index 82efc62..6a3cd3b 100644 --- a/tests/ref/vsynth/vsynth1-wmv2 +++ b/tests/ref/vsynth/vsynth1-wmv2 @@ -1,4 +1,4 @@ -fc0796c6c49a18034cef008d61c0d964 *tests/data/fate/vsynth1-wmv2.avi -659840 tests/data/fate/vsynth1-wmv2.avi -5182edba5b5e0354b39ce4f3604b62da *tests/data/fate/vsynth1-wmv2.out.rawvideo -stddev: 7.97 PSNR: 30.09 MAXDIFF: 110 bytes: 7603200/ 7603200 +3c8a93fa645574f5b11eb51cf0efd227 *tests/data/fate/vsynth1-wmv2.avi +659162 tests/data/fate/vsynth1-wmv2.avi +2d61f24836d54766e8d370f243d83dcd *tests/data/fate/vsynth1-wmv2.out.rawvideo +stddev: 7.97 PSNR: 30.09 MAXDIFF: 105 bytes: 7603200/ 7603200 diff --git a/tests/ref/vsynth/vsynth2-wmv2 b/tests/ref/vsynth/vsynth2-wmv2 index 043dac9..25c0dee 100644 --- a/tests/ref/vsynth/vsynth2-wmv2 +++ b/tests/ref/vsynth/vsynth2-wmv2 @@ -1,4 +1,4 @@ -0760abea07c386ab956fa1bb8b14c599 *tests/data/fate/vsynth2-wmv2.avi +c7db61ce6fc07e8fb9a7204992c2e4c4 *tests/data/fate/vsynth2-wmv2.avi 129848 tests/data/fate/vsynth2-wmv2.avi -81eee429b665254d19a06607463c0b5e *tests/data/fate/vsynth2-wmv2.out.rawvideo -stddev: 5.33 PSNR: 33.60 MAXDIFF: 77 bytes: 7603200/ 7603200 +288bdf1b411b814a067ceb00ac6b9d16 *tests/data/fate/vsynth2-wmv2.out.rawvideo +stddev: 5.33 PSNR: 33.59 MAXDIFF: 77 bytes: 7603200/ 7603200 -- 1.7.11.3 _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel