From 074eef56ef4ad4af3cb4d5a1265efb00ec6d9858 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 18 Sep 2014 14:02:33 +0200 Subject: [PATCH 1/5] fate: add fate-filter-pp1 This tests a few more filters with forced quantizers Signed-off-by: Michael Niedermayer --- tests/fate/filter-video.mak | 3 +++ tests/ref/fate/filter-pp1 | 1 + 2 files changed, 4 insertions(+) create mode 100644 tests/ref/fate/filter-pp1 diff --git a/tests/fate/filter-video.mak b/tests/fate/filter-video.mak index 9239b379dd..c49cf00388 100644 --- a/tests/fate/filter-video.mak +++ b/tests/fate/filter-video.mak @@ -229,6 +229,9 @@ fate-filter-pad: CMD = video_filter "pad=iw*1.5:ih*1.5:iw*0.3:ih*0.2" FATE_FILTER_VSYNTH-$(CONFIG_PP_FILTER) += fate-filter-pp fate-filter-pp: CMD = video_filter "pp=be/hb/vb/tn/l5/al" +FATE_FILTER_VSYNTH-$(CONFIG_PP_FILTER) += fate-filter-pp1 +fate-filter-pp1: CMD = video_filter "pp=fq|4/be/hb/vb/tn/l5/al" + FATE_FILTER_VSYNTH-$(CONFIG_PP_FILTER) += fate-filter-pp2 fate-filter-pp2: CMD = video_filter "pp=be/fq|16/h1/v1/lb" diff --git a/tests/ref/fate/filter-pp1 b/tests/ref/fate/filter-pp1 new file mode 100644 index 0000000000..b129ea39ee --- /dev/null +++ b/tests/ref/fate/filter-pp1 @@ -0,0 +1 @@ +pp1 cb9f884e27a5be11f72afc9b517efd10 From 9f9ebe631dc1162c89115c9cf408a348dd3e46aa Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 18 Sep 2014 14:06:43 +0200 Subject: [PATCH 2/5] libpostproc/postprocess: avoid some if() Signed-off-by: Michael Niedermayer --- libpostproc/postprocess.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c index 01ec0f9867..3396f56eb7 100644 --- a/libpostproc/postprocess.c +++ b/libpostproc/postprocess.c @@ -209,13 +209,13 @@ static inline int isHorizDC_C(const uint8_t src[], int stride, const PPContext * const int dcThreshold= dcOffset*2 + 1; for(y=0; y c->ppMode.flatnessThreshold; @@ -233,14 +233,14 @@ static inline int isVertDC_C(const uint8_t src[], int stride, const PPContext *c src+= stride*4; // src points to begin of the 8x8 Block for(y=0; y c->ppMode.flatnessThreshold; From 44dabf1f422b9d3be470be8ead8f15c802939f7f Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 18 Sep 2014 14:09:20 +0200 Subject: [PATCH 3/5] postproc: simplify forwarding return codes Signed-off-by: Michael Niedermayer --- libpostproc/postprocess.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c index 3396f56eb7..691c9bf9f0 100644 --- a/libpostproc/postprocess.c +++ b/libpostproc/postprocess.c @@ -278,10 +278,7 @@ static inline int isVertMinMaxOk_C(const uint8_t src[], int stride, int QP) static inline int horizClassify_C(const uint8_t src[], int stride, const PPContext *c) { if( isHorizDC_C(src, stride, c) ){ - if( isHorizMinMaxOk_C(src, stride, c->QP) ) - return 1; - else - return 0; + return isHorizMinMaxOk_C(src, stride, c->QP); }else{ return 2; } @@ -290,10 +287,7 @@ static inline int horizClassify_C(const uint8_t src[], int stride, const PPConte static inline int vertClassify_C(const uint8_t src[], int stride, const PPContext *c) { if( isVertDC_C(src, stride, c) ){ - if( isVertMinMaxOk_C(src, stride, c->QP) ) - return 1; - else - return 0; + return isVertMinMaxOk_C(src, stride, c->QP); }else{ return 2; } From 921caf620386cc480da5166dd38dc136bfcd754e Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 18 Sep 2014 14:19:08 +0200 Subject: [PATCH 4/5] postprocess: make some variables in pp_get_mode_by_name_and_quality() const Signed-off-by: Michael Niedermayer --- libpostproc/postprocess.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c index 691c9bf9f0..af3219481f 100644 --- a/libpostproc/postprocess.c +++ b/libpostproc/postprocess.c @@ -698,12 +698,12 @@ pp_mode *pp_get_mode_by_name_and_quality(const char *name, int quality) av_log(NULL, AV_LOG_DEBUG, "pp: %s\n", name); for(;;){ - char *filterName; + const char *filterName; int q= 1000000; //PP_QUALITY_MAX; int chrom=-1; int luma=-1; - char *option; - char *options[OPTIONS_ARRAY_SIZE]; + const char *option; + const char *options[OPTIONS_ARRAY_SIZE]; int i; int filterNameOk=0; int numOfUnknownOptions=0; From 9e8be462521e1c66c5ae0f3e3fe8ece18a0fb931 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 18 Sep 2014 14:21:27 +0200 Subject: [PATCH 5/5] postproc/postprocess: use av_strtok() Signed-off-by: Michael Niedermayer --- libpostproc/postprocess.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c index af3219481f..6dee0417e5 100644 --- a/libpostproc/postprocess.c +++ b/libpostproc/postprocess.c @@ -708,11 +708,12 @@ pp_mode *pp_get_mode_by_name_and_quality(const char *name, int quality) int filterNameOk=0; int numOfUnknownOptions=0; int enable=1; //does the user want us to enabled or disabled the filter + char *tokstate; - filterToken= strtok(p, filterDelimiters); + filterToken= av_strtok(p, filterDelimiters, &tokstate); if(!filterToken) break; p+= strlen(filterToken) + 1; // p points to next filterToken - filterName= strtok(filterToken, optionDelimiters); + filterName= av_strtok(filterToken, optionDelimiters, &tokstate); if (!filterName) { ppMode->error++; break; @@ -725,7 +726,7 @@ pp_mode *pp_get_mode_by_name_and_quality(const char *name, int quality) } for(;;){ //for all options - option= strtok(NULL, optionDelimiters); + option= av_strtok(NULL, optionDelimiters, &tokstate); if(!option) break; av_log(NULL, AV_LOG_DEBUG, "pp: option: %s\n", option);