Re: [FFmpeg-devel] [PATCH] lavfi: Port mp=pp7 to libavfilter

2015-01-13 Thread Stefano Sabatini
On date Saturday 2015-01-10 01:46:38 +0530, Arwa Arif encoded:
 On Fri, Jan 9, 2015 at 10:07 PM, Stefano Sabatini stefa...@gmail.com
[...]
 From 2367adb44a62e67427f0de5af8047a0008f3b0f8 Mon Sep 17 00:00:00 2001
 From: Arwa Arif arwaarif1...@gmail.com
 Date: Sat, 10 Jan 2015 01:21:14 +0530
 Subject: [PATCH] Remove mp=pp7
 
 ---
  doc/filters.texi |1 -
  libavfilter/Makefile |1 -
  libavfilter/libmpcodecs/vf_pp7.c |  491 
 --
  libavfilter/vf_mp.c  |2 -
  4 files changed, 495 deletions(-)
  delete mode 100644 libavfilter/libmpcodecs/vf_pp7.c

Applied, thanks.

For the next time, please post each new patch to a new dedicated
thread.
-- 
FFmpeg = Frightening  Freak Merciful Powered Exciting Gospel
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi: Port mp=pp7 to libavfilter

2015-01-09 Thread Michael Niedermayer
On Sat, Jan 10, 2015 at 01:46:38AM +0530, arwa arif wrote:
 On Fri, Jan 9, 2015 at 10:07 PM, Stefano Sabatini stefa...@gmail.com
 wrote:
 
  On date Wednesday 2015-01-07 19:14:49 +0530, arwa arif encoded:
  [...]
   From 2676f37a204b48bdbb2e24359b6a85598a8c021b Mon Sep 17 00:00:00 2001
   From: Arwa Arif arwaarif1...@gmail.com
   Date: Thu, 25 Dec 2014 09:50:24 +0530
   Subject: [PATCH] lavfi: port mp=pp7 to avfilter
  
   TODO: modify version.h, Add ff_norm_qscale in internal.h
   ---
LICENSE.md   |1 +
configure|1 +
doc/filters.texi |   31 
libavfilter/Makefile |1 +
libavfilter/allfilters.c |1 +
libavfilter/vf_pp7.c |  419
  ++
libavfilter/vf_pp7.h |   46 +
libavfilter/x86/Makefile |1 +
libavfilter/x86/vf_pp7.c |   68 
9 files changed, 569 insertions(+)
create mode 100644 libavfilter/vf_pp7.c
create mode 100644 libavfilter/vf_pp7.h
create mode 100644 libavfilter/x86/vf_pp7.c
 
  Patch applied, thanks.
 
  Please provide a patch to factorize the use of norm_qscale(), to
  remove mp=pp7, and to readd the use_bframe_qp if you think it's
  useful.
 
 
 I have attached the patch to remove mp=pp7 and factorize the use of
 norm_qscale.

applied factorization patch
thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

During times of universal deceit, telling the truth becomes a
revolutionary act. -- George Orwell


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi: Port mp=pp7 to libavfilter

2015-01-09 Thread Stefano Sabatini
On date Friday 2015-01-09 15:00:58 +0100, Michael Niedermayer encoded:
 On Fri, Jan 09, 2015 at 12:08:21PM +0530, arwa arif wrote:
[...]
  They are using mp=pp7=0:0 as default. But, in documentation they have
  mentioned that medium thresholding (mp=pp7=0:2) is default. What should I
  follow?
 
 its probably less confusing to use the same default as the mp=pp7
 code does otherwise any default is fine

If I specify the mode I get the same output. I'm fine keeping medium
as default, as stated in the docs.
-- 
FFmpeg = Freak  Frenzy MultiPurpose Evanescent Gem
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi: Port mp=pp7 to libavfilter

2015-01-09 Thread Stefano Sabatini
On date Wednesday 2015-01-07 19:14:49 +0530, arwa arif encoded:
[...]
 From 2676f37a204b48bdbb2e24359b6a85598a8c021b Mon Sep 17 00:00:00 2001
 From: Arwa Arif arwaarif1...@gmail.com
 Date: Thu, 25 Dec 2014 09:50:24 +0530
 Subject: [PATCH] lavfi: port mp=pp7 to avfilter
 
 TODO: modify version.h, Add ff_norm_qscale in internal.h
 ---
  LICENSE.md   |1 +
  configure|1 +
  doc/filters.texi |   31 
  libavfilter/Makefile |1 +
  libavfilter/allfilters.c |1 +
  libavfilter/vf_pp7.c |  419 
 ++
  libavfilter/vf_pp7.h |   46 +
  libavfilter/x86/Makefile |1 +
  libavfilter/x86/vf_pp7.c |   68 
  9 files changed, 569 insertions(+)
  create mode 100644 libavfilter/vf_pp7.c
  create mode 100644 libavfilter/vf_pp7.h
  create mode 100644 libavfilter/x86/vf_pp7.c

Patch applied, thanks.

Please provide a patch to factorize the use of norm_qscale(), to
remove mp=pp7, and to readd the use_bframe_qp if you think it's
useful.
-- 
FFmpeg = Faithful  Furious Multimedia Practical Exciting Genius
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi: Port mp=pp7 to libavfilter

2015-01-09 Thread Michael Niedermayer
On Fri, Jan 09, 2015 at 12:08:21PM +0530, arwa arif wrote:
 On Fri, Jan 9, 2015 at 12:27 AM, Michael Niedermayer michae...@gmx.at
 wrote:
 
  On Thu, Jan 08, 2015 at 04:03:18PM +0100, Michael Niedermayer wrote:
   On Thu, Jan 08, 2015 at 07:32:51PM +0530, arwa arif wrote:
On Thu, Jan 8, 2015 at 7:23 PM, Michael Niedermayer michae...@gmx.at
wrote:
   
 On Thu, Jan 08, 2015 at 01:43:24PM +0530, arwa arif wrote:
  On Wed, Jan 7, 2015 at 9:46 PM, Michael Niedermayer 
  michae...@gmx.at
  wrote:
 
   On Wed, Jan 07, 2015 at 03:42:16PM +0100, Stefano Sabatini wrote:
On date Wednesday 2015-01-07 19:14:49 +0530, arwa arif encoded:
 
 
  Keep in mind that the difference may be due to the QP
  information
  missing in mp=pp7. So you should focus on that (try to
 reset/disable
  qp processing in pp7 and see if it works the same as
  mp=pp7).
 

   
 For qp=0, the results are bitexact. I am not able to figure
  out
 how do
   I
 take care
   
Isn't qp=0 the default? How do you get (with which parameters)
  mp=pp7
and pp7 to issue the same output?
  
   i get the same output for
   mp=pp7=10:0 and  pp7=10:0
   mp=pp7=10:1 and  pp7=10:1
   mp=pp7=10:2 and  pp7=10:2
  
   the default for mode seems to differ though so the mode has to be
   specified for comparing
  
  
  But I am getting same ouput for default mode,  i.e,
  mp=pp7=0:0 and  pp7=0:0
  mp=pp7=0:1 and  pp7=0:1
  mp=pp7=0:2 and  pp7=0:2
 
  When qp is a non-zero value, the output is different.

 it was the same here, how can i reproduce a case where it differs ?
 what input did you use ? what command line ?

   
I compared it for mp=pp7=30 and pp7=30.
The command line I used was:
./ffmpeg -i ../a.png -vf pp7=30 -f md5 ../new
./ffmpeg -i ../a.png -vf mp=pp7=30 -f md5 ../old
  
   as the default mode differs you must specify the mode
   like
   -vf pp7=30:0
   -vf mp=pp7=30:0
   or
   -vf pp7=30:1
   -vf mp=pp7=30:1
   or
   -vf pp7=30:2
   -vf mp=pp7=30:2
  
   or change the default so it matches
 
  ./ffmpeg -v 0 -i matrixbench_mpeg2.mpg -vf mp=pp7=30:1 -t 1 -f md5 -
  MD5=a96e711815a1006cc3e9faec8e6bee66
 
  ./ffmpeg -v 0 -i matrixbench_mpeg2.mpg -vf pp7=30:1 -t 1 -f md5 -
  MD5=a96e711815a1006cc3e9faec8e6bee66
 
 
 They are using mp=pp7=0:0 as default. But, in documentation they have
 mentioned that medium thresholding (mp=pp7=0:2) is default. What should I
 follow?

its probably less confusing to use the same default as the mp=pp7
code does otherwise any default is fine

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi: Port mp=pp7 to libavfilter

2015-01-08 Thread arwa arif
On Fri, Jan 9, 2015 at 12:27 AM, Michael Niedermayer michae...@gmx.at
wrote:

 On Thu, Jan 08, 2015 at 04:03:18PM +0100, Michael Niedermayer wrote:
  On Thu, Jan 08, 2015 at 07:32:51PM +0530, arwa arif wrote:
   On Thu, Jan 8, 2015 at 7:23 PM, Michael Niedermayer michae...@gmx.at
   wrote:
  
On Thu, Jan 08, 2015 at 01:43:24PM +0530, arwa arif wrote:
 On Wed, Jan 7, 2015 at 9:46 PM, Michael Niedermayer 
 michae...@gmx.at
 wrote:

  On Wed, Jan 07, 2015 at 03:42:16PM +0100, Stefano Sabatini wrote:
   On date Wednesday 2015-01-07 19:14:49 +0530, arwa arif encoded:


 Keep in mind that the difference may be due to the QP
 information
 missing in mp=pp7. So you should focus on that (try to
reset/disable
 qp processing in pp7 and see if it works the same as
 mp=pp7).

   
  
For qp=0, the results are bitexact. I am not able to figure
 out
how do
  I
take care
  
   Isn't qp=0 the default? How do you get (with which parameters)
 mp=pp7
   and pp7 to issue the same output?
 
  i get the same output for
  mp=pp7=10:0 and  pp7=10:0
  mp=pp7=10:1 and  pp7=10:1
  mp=pp7=10:2 and  pp7=10:2
 
  the default for mode seems to differ though so the mode has to be
  specified for comparing
 
 
 But I am getting same ouput for default mode,  i.e,
 mp=pp7=0:0 and  pp7=0:0
 mp=pp7=0:1 and  pp7=0:1
 mp=pp7=0:2 and  pp7=0:2

 When qp is a non-zero value, the output is different.
   
it was the same here, how can i reproduce a case where it differs ?
what input did you use ? what command line ?
   
  
   I compared it for mp=pp7=30 and pp7=30.
   The command line I used was:
   ./ffmpeg -i ../a.png -vf pp7=30 -f md5 ../new
   ./ffmpeg -i ../a.png -vf mp=pp7=30 -f md5 ../old
 
  as the default mode differs you must specify the mode
  like
  -vf pp7=30:0
  -vf mp=pp7=30:0
  or
  -vf pp7=30:1
  -vf mp=pp7=30:1
  or
  -vf pp7=30:2
  -vf mp=pp7=30:2
 
  or change the default so it matches

 ./ffmpeg -v 0 -i matrixbench_mpeg2.mpg -vf mp=pp7=30:1 -t 1 -f md5 -
 MD5=a96e711815a1006cc3e9faec8e6bee66

 ./ffmpeg -v 0 -i matrixbench_mpeg2.mpg -vf pp7=30:1 -t 1 -f md5 -
 MD5=a96e711815a1006cc3e9faec8e6bee66


They are using mp=pp7=0:0 as default. But, in documentation they have
mentioned that medium thresholding (mp=pp7=0:2) is default. What should I
follow?

[...]

 --
 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

 During times of universal deceit, telling the truth becomes a
 revolutionary act. -- George Orwell

 ___
 ffmpeg-devel mailing list
 ffmpeg-devel@ffmpeg.org
 http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi: Port mp=pp7 to libavfilter

2015-01-08 Thread arwa arif
On Wed, Jan 7, 2015 at 9:46 PM, Michael Niedermayer michae...@gmx.at
wrote:

 On Wed, Jan 07, 2015 at 03:42:16PM +0100, Stefano Sabatini wrote:
  On date Wednesday 2015-01-07 19:14:49 +0530, arwa arif encoded:
   
   
Keep in mind that the difference may be due to the QP information
missing in mp=pp7. So you should focus on that (try to reset/disable
qp processing in pp7 and see if it works the same as mp=pp7).
   
  
 
   For qp=0, the results are bitexact. I am not able to figure out how do
 I
   take care
 
  Isn't qp=0 the default? How do you get (with which parameters) mp=pp7
  and pp7 to issue the same output?

 i get the same output for
 mp=pp7=10:0 and  pp7=10:0
 mp=pp7=10:1 and  pp7=10:1
 mp=pp7=10:2 and  pp7=10:2

 the default for mode seems to differ though so the mode has to be
 specified for comparing


But I am getting same ouput for default mode,  i.e,
mp=pp7=0:0 and  pp7=0:0
mp=pp7=0:1 and  pp7=0:1
mp=pp7=0:2 and  pp7=0:2

When qp is a non-zero value, the output is different.

[...]
 --
 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

 There will always be a question for which you do not know the correct
 answer.

 ___
 ffmpeg-devel mailing list
 ffmpeg-devel@ffmpeg.org
 http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi: Port mp=pp7 to libavfilter

2015-01-08 Thread Michael Niedermayer
On Thu, Jan 08, 2015 at 01:43:24PM +0530, arwa arif wrote:
 On Wed, Jan 7, 2015 at 9:46 PM, Michael Niedermayer michae...@gmx.at
 wrote:
 
  On Wed, Jan 07, 2015 at 03:42:16PM +0100, Stefano Sabatini wrote:
   On date Wednesday 2015-01-07 19:14:49 +0530, arwa arif encoded:


 Keep in mind that the difference may be due to the QP information
 missing in mp=pp7. So you should focus on that (try to reset/disable
 qp processing in pp7 and see if it works the same as mp=pp7).

   
  
For qp=0, the results are bitexact. I am not able to figure out how do
  I
take care
  
   Isn't qp=0 the default? How do you get (with which parameters) mp=pp7
   and pp7 to issue the same output?
 
  i get the same output for
  mp=pp7=10:0 and  pp7=10:0
  mp=pp7=10:1 and  pp7=10:1
  mp=pp7=10:2 and  pp7=10:2
 
  the default for mode seems to differ though so the mode has to be
  specified for comparing
 
 
 But I am getting same ouput for default mode,  i.e,
 mp=pp7=0:0 and  pp7=0:0
 mp=pp7=0:1 and  pp7=0:1
 mp=pp7=0:2 and  pp7=0:2
 
 When qp is a non-zero value, the output is different.

it was the same here, how can i reproduce a case where it differs ?
what input did you use ? what command line ?

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Into a blind darkness they enter who follow after the Ignorance,
they as if into a greater darkness enter who devote themselves
to the Knowledge alone. -- Isha Upanishad


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi: Port mp=pp7 to libavfilter

2015-01-08 Thread arwa arif
On Thu, Jan 8, 2015 at 7:23 PM, Michael Niedermayer michae...@gmx.at
wrote:

 On Thu, Jan 08, 2015 at 01:43:24PM +0530, arwa arif wrote:
  On Wed, Jan 7, 2015 at 9:46 PM, Michael Niedermayer michae...@gmx.at
  wrote:
 
   On Wed, Jan 07, 2015 at 03:42:16PM +0100, Stefano Sabatini wrote:
On date Wednesday 2015-01-07 19:14:49 +0530, arwa arif encoded:
 
 
  Keep in mind that the difference may be due to the QP information
  missing in mp=pp7. So you should focus on that (try to
 reset/disable
  qp processing in pp7 and see if it works the same as mp=pp7).
 

   
 For qp=0, the results are bitexact. I am not able to figure out
 how do
   I
 take care
   
Isn't qp=0 the default? How do you get (with which parameters) mp=pp7
and pp7 to issue the same output?
  
   i get the same output for
   mp=pp7=10:0 and  pp7=10:0
   mp=pp7=10:1 and  pp7=10:1
   mp=pp7=10:2 and  pp7=10:2
  
   the default for mode seems to differ though so the mode has to be
   specified for comparing
  
  
  But I am getting same ouput for default mode,  i.e,
  mp=pp7=0:0 and  pp7=0:0
  mp=pp7=0:1 and  pp7=0:1
  mp=pp7=0:2 and  pp7=0:2
 
  When qp is a non-zero value, the output is different.

 it was the same here, how can i reproduce a case where it differs ?
 what input did you use ? what command line ?


I compared it for mp=pp7=30 and pp7=30.
The command line I used was:
./ffmpeg -i ../a.png -vf pp7=30 -f md5 ../new
./ffmpeg -i ../a.png -vf mp=pp7=30 -f md5 ../old




 [...]
 --
 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

 Into a blind darkness they enter who follow after the Ignorance,
 they as if into a greater darkness enter who devote themselves
 to the Knowledge alone. -- Isha Upanishad

 ___
 ffmpeg-devel mailing list
 ffmpeg-devel@ffmpeg.org
 http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi: Port mp=pp7 to libavfilter

2015-01-08 Thread Michael Niedermayer
On Thu, Jan 08, 2015 at 07:32:51PM +0530, arwa arif wrote:
 On Thu, Jan 8, 2015 at 7:23 PM, Michael Niedermayer michae...@gmx.at
 wrote:
 
  On Thu, Jan 08, 2015 at 01:43:24PM +0530, arwa arif wrote:
   On Wed, Jan 7, 2015 at 9:46 PM, Michael Niedermayer michae...@gmx.at
   wrote:
  
On Wed, Jan 07, 2015 at 03:42:16PM +0100, Stefano Sabatini wrote:
 On date Wednesday 2015-01-07 19:14:49 +0530, arwa arif encoded:
  
  
   Keep in mind that the difference may be due to the QP information
   missing in mp=pp7. So you should focus on that (try to
  reset/disable
   qp processing in pp7 and see if it works the same as mp=pp7).
  
 

  For qp=0, the results are bitexact. I am not able to figure out
  how do
I
  take care

 Isn't qp=0 the default? How do you get (with which parameters) mp=pp7
 and pp7 to issue the same output?
   
i get the same output for
mp=pp7=10:0 and  pp7=10:0
mp=pp7=10:1 and  pp7=10:1
mp=pp7=10:2 and  pp7=10:2
   
the default for mode seems to differ though so the mode has to be
specified for comparing
   
   
   But I am getting same ouput for default mode,  i.e,
   mp=pp7=0:0 and  pp7=0:0
   mp=pp7=0:1 and  pp7=0:1
   mp=pp7=0:2 and  pp7=0:2
  
   When qp is a non-zero value, the output is different.
 
  it was the same here, how can i reproduce a case where it differs ?
  what input did you use ? what command line ?
 
 
 I compared it for mp=pp7=30 and pp7=30.
 The command line I used was:
 ./ffmpeg -i ../a.png -vf pp7=30 -f md5 ../new
 ./ffmpeg -i ../a.png -vf mp=pp7=30 -f md5 ../old

as the default mode differs you must specify the mode
like
-vf pp7=30:0
-vf mp=pp7=30:0
or
-vf pp7=30:1
-vf mp=pp7=30:1
or
-vf pp7=30:2
-vf mp=pp7=30:2

or change the default so it matches

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi: Port mp=pp7 to libavfilter

2015-01-08 Thread Michael Niedermayer
On Thu, Jan 08, 2015 at 04:03:18PM +0100, Michael Niedermayer wrote:
 On Thu, Jan 08, 2015 at 07:32:51PM +0530, arwa arif wrote:
  On Thu, Jan 8, 2015 at 7:23 PM, Michael Niedermayer michae...@gmx.at
  wrote:
  
   On Thu, Jan 08, 2015 at 01:43:24PM +0530, arwa arif wrote:
On Wed, Jan 7, 2015 at 9:46 PM, Michael Niedermayer michae...@gmx.at
wrote:
   
 On Wed, Jan 07, 2015 at 03:42:16PM +0100, Stefano Sabatini wrote:
  On date Wednesday 2015-01-07 19:14:49 +0530, arwa arif encoded:
   
   
Keep in mind that the difference may be due to the QP 
information
missing in mp=pp7. So you should focus on that (try to
   reset/disable
qp processing in pp7 and see if it works the same as mp=pp7).
   
  
 
   For qp=0, the results are bitexact. I am not able to figure out
   how do
 I
   take care
 
  Isn't qp=0 the default? How do you get (with which parameters) 
  mp=pp7
  and pp7 to issue the same output?

 i get the same output for
 mp=pp7=10:0 and  pp7=10:0
 mp=pp7=10:1 and  pp7=10:1
 mp=pp7=10:2 and  pp7=10:2

 the default for mode seems to differ though so the mode has to be
 specified for comparing


But I am getting same ouput for default mode,  i.e,
mp=pp7=0:0 and  pp7=0:0
mp=pp7=0:1 and  pp7=0:1
mp=pp7=0:2 and  pp7=0:2
   
When qp is a non-zero value, the output is different.
  
   it was the same here, how can i reproduce a case where it differs ?
   what input did you use ? what command line ?
  
  
  I compared it for mp=pp7=30 and pp7=30.
  The command line I used was:
  ./ffmpeg -i ../a.png -vf pp7=30 -f md5 ../new
  ./ffmpeg -i ../a.png -vf mp=pp7=30 -f md5 ../old
 
 as the default mode differs you must specify the mode
 like
 -vf pp7=30:0
 -vf mp=pp7=30:0
 or
 -vf pp7=30:1
 -vf mp=pp7=30:1
 or
 -vf pp7=30:2
 -vf mp=pp7=30:2
 
 or change the default so it matches

./ffmpeg -v 0 -i matrixbench_mpeg2.mpg -vf mp=pp7=30:1 -t 1 -f md5 -
MD5=a96e711815a1006cc3e9faec8e6bee66

./ffmpeg -v 0 -i matrixbench_mpeg2.mpg -vf pp7=30:1 -t 1 -f md5 -
MD5=a96e711815a1006cc3e9faec8e6bee66

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

During times of universal deceit, telling the truth becomes a
revolutionary act. -- George Orwell


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi: Port mp=pp7 to libavfilter

2015-01-07 Thread Stefano Sabatini
On date Wednesday 2015-01-07 19:14:49 +0530, arwa arif encoded:
 
 
  Keep in mind that the difference may be due to the QP information
  missing in mp=pp7. So you should focus on that (try to reset/disable
  qp processing in pp7 and see if it works the same as mp=pp7).
 
 

 For qp=0, the results are bitexact. I am not able to figure out how do I
 take care

Isn't qp=0 the default? How do you get (with which parameters) mp=pp7
and pp7 to issue the same output?

 of the non zero qp case. In the original code, the value is directly
 accessed by
 the frame (mpi-qscale).

 I tried using memset, but it is giving some memory errors. In memset, we use
 the first argument as the pointer to the block and the last as the size of
 the block,
 right?

something like:

memset(qp_table-data, 0, qp_table-size); 

 
 For documentation, can you provide me with a standard image? Because, the
 one I am using is not giving results which are presentable. There is not
 much
 difference if I vary the parameters (In fact the filters are also giving
 the same result).

I guess this is for the postprocessing comparison document, right? It
is important you use low-quality content (e.g. matrix_bench.mpg
encoded to 200Kbits/s) or you can use the reference images here:
http://www.compression.ru/video/deblocking/index_en.html

[...]
-- 
FFmpeg = Faithful and Freak Magnificient Philosophical Elastic Game
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi: Port mp=pp7 to libavfilter

2015-01-07 Thread arwa arif


 Keep in mind that the difference may be due to the QP information
 missing in mp=pp7. So you should focus on that (try to reset/disable
 qp processing in pp7 and see if it works the same as mp=pp7).


For qp=0, the results are bitexact. I am not able to figure out how do I
take care
of the non zero qp case. In the original code, the value is directly
accessed by
the frame (mpi-qscale).

I tried using memset, but it is giving some memory errors. In memset, we use
the first argument as the pointer to the block and the last as the size of
the block,
right?

For documentation, can you provide me with a standard image? Because, the
one I am using is not giving results which are presentable. There is not
much
difference if I vary the parameters (In fact the filters are also giving
the same result).


 --
 FFmpeg = Foolish and Frenzy Mystic Puritan Elitist Geisha
 ___
 ffmpeg-devel mailing list
 ffmpeg-devel@ffmpeg.org
 http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

From 2676f37a204b48bdbb2e24359b6a85598a8c021b Mon Sep 17 00:00:00 2001
From: Arwa Arif arwaarif1...@gmail.com
Date: Thu, 25 Dec 2014 09:50:24 +0530
Subject: [PATCH] lavfi: port mp=pp7 to avfilter

TODO: modify version.h, Add ff_norm_qscale in internal.h
---
 LICENSE.md   |1 +
 configure|1 +
 doc/filters.texi |   31 
 libavfilter/Makefile |1 +
 libavfilter/allfilters.c |1 +
 libavfilter/vf_pp7.c |  419 ++
 libavfilter/vf_pp7.h |   46 +
 libavfilter/x86/Makefile |1 +
 libavfilter/x86/vf_pp7.c |   68 
 9 files changed, 569 insertions(+)
 create mode 100644 libavfilter/vf_pp7.c
 create mode 100644 libavfilter/vf_pp7.h
 create mode 100644 libavfilter/x86/vf_pp7.c

diff --git a/LICENSE.md b/LICENSE.md
index 5659973..e612c22 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -43,6 +43,7 @@ Specifically, the GPL parts of FFmpeg are:
 - vf_perspective.c
 - vf_phase.c
 - vf_pp.c
+- vf_pp7.c
 - vf_pullup.c
 - vf_sab.c
 - vf_smartblur.c
diff --git a/configure b/configure
index 9085200..c73562b 100755
--- a/configure
+++ b/configure
@@ -2597,6 +2597,7 @@ mpdecimate_filter_select=pixelutils
 mptestsrc_filter_deps=gpl
 negate_filter_deps=lut_filter
 perspective_filter_deps=gpl
+pp7_filter_deps=gpl
 ocv_filter_deps=libopencv
 owdenoise_filter_deps=gpl
 pan_filter_deps=swresample
diff --git a/doc/filters.texi b/doc/filters.texi
index aa8bb61..428785e 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -7171,6 +7171,37 @@ pp=hb|y/vb|a
 @end example
 @end itemize
 
+@section pp7
+Apply Postprocessing filter 7. It is variant of the @ref{spp} filter,
+similar to spp = 6 with 7 point DCT, where only the center sample is
+used after IDCT.
+
+The filter accepts the following options:
+
+@table @option
+@item qp
+Force a constant quantization parameter. It accepts an integer in range
+0 to 63. If not set, the filter will use the QP from the video stream
+(if available).
+
+@item mode
+Set thresholding mode. Available modes are:
+
+@table @samp
+@item hard
+Set hard thresholding.
+@item soft
+Set soft thresholding (better de-ringing effect, but likely blurrier).
+@item medium
+Set medium thresholding (good results, default).
+@end table
+
+@item use_bframe_qp
+Enable the use of the QP from the B-Frames if set to @code{1}. Using this
+option may cause flicker since the B-Frames have often larger QP. Default is
+@code{0} (not enabled).
+@end table
+
 @section psnr
 
 Obtain the average, maximum and minimum PSNR (Peak Signal to Noise
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index cdcbe0a..8fcb270 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -164,6 +164,7 @@ OBJS-$(CONFIG_PERSPECTIVE_FILTER)+= vf_perspective.o
 OBJS-$(CONFIG_PHASE_FILTER)  += vf_phase.o
 OBJS-$(CONFIG_PIXDESCTEST_FILTER)+= vf_pixdesctest.o
 OBJS-$(CONFIG_PP_FILTER) += vf_pp.o
+OBJS-$(CONFIG_PP7_FILTER)+= vf_pp7.o
 OBJS-$(CONFIG_PSNR_FILTER)   += vf_psnr.o dualinput.o framesync.o
 OBJS-$(CONFIG_PULLUP_FILTER) += vf_pullup.o
 OBJS-$(CONFIG_REMOVELOGO_FILTER) += bbox.o lswsutils.o lavfutils.o vf_removelogo.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 2911ed9..381da4f 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -179,6 +179,7 @@ void avfilter_register_all(void)
 REGISTER_FILTER(PHASE,  phase,  vf);
 REGISTER_FILTER(PIXDESCTEST,pixdesctest,vf);
 REGISTER_FILTER(PP, pp, vf);
+REGISTER_FILTER(PP7,pp7,vf);
 REGISTER_FILTER(PSNR,   psnr,   vf);
 REGISTER_FILTER(PULLUP, pullup, vf);
 REGISTER_FILTER(REMOVELOGO, removelogo, vf);
diff --git a/libavfilter/vf_pp7.c 

Re: [FFmpeg-devel] [PATCH] lavfi: Port mp=pp7 to libavfilter

2015-01-07 Thread Michael Niedermayer
On Wed, Jan 07, 2015 at 03:42:16PM +0100, Stefano Sabatini wrote:
 On date Wednesday 2015-01-07 19:14:49 +0530, arwa arif encoded:
  
  
   Keep in mind that the difference may be due to the QP information
   missing in mp=pp7. So you should focus on that (try to reset/disable
   qp processing in pp7 and see if it works the same as mp=pp7).
  
  
 
  For qp=0, the results are bitexact. I am not able to figure out how do I
  take care
 
 Isn't qp=0 the default? How do you get (with which parameters) mp=pp7
 and pp7 to issue the same output?

i get the same output for
mp=pp7=10:0 and  pp7=10:0
mp=pp7=10:1 and  pp7=10:1
mp=pp7=10:2 and  pp7=10:2

the default for mode seems to differ though so the mode has to be
specified for comparing

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

There will always be a question for which you do not know the correct answer.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi: Port mp=pp7 to libavfilter

2015-01-05 Thread Stefano Sabatini
On date Monday 2014-12-29 10:20:26 +0100, Stefano Sabatini encoded:
 On date Sunday 2014-12-28 19:45:18 +0530, arwa arif encoded:
 [...]
  From ebf5f36d9e9fc80264bb605dfee5c09cbf1f10ef Mon Sep 17 00:00:00 2001
  From: Arwa Arif arwaarif1...@gmail.com
  Date: Thu, 25 Dec 2014 09:50:24 +0530
  Subject: [PATCH] lavfi: port mp=pp7 to avfilter
  
 
  Added use_bframe_qp in the list of options.
 

 Also, add use_bframe_qp option.

Please remove this and add it on top of the pp7 port patch.
 
 I'd also suggest to implement this on top of the port.
 
  TODO: modify version.h, Add ff_norm_qscale in internal.h
  ---
   LICENSE.md   |1 +
   configure|1 +
   doc/filters.texi |   31 
   libavfilter/Makefile |1 +
   libavfilter/allfilters.c |1 +
   libavfilter/vf_pp7.c |  460 
  ++
   libavfilter/vf_pp7.h |   49 +
   libavfilter/x86/Makefile |1 +
   libavfilter/x86/vf_pp7.c |   68 +++
   9 files changed, 613 insertions(+)
   create mode 100644 libavfilter/vf_pp7.c
   create mode 100644 libavfilter/vf_pp7.h
   create mode 100644 libavfilter/x86/vf_pp7.c
 
 [...]
 
 It is not bitexact here.
 
 ffmpeg -i matrixbench_mpeg2-lq.mpg -vf mp=pp7=30 -t 2 -f md5 -
 [...]
 MD5=b281d6e4c077f4bf992dae262bc1cd3e
 
 ffmpeg -i matrixbench_mpeg2-lq.mpg -vf pp7=30 -t 2 -f md5 -
 [...]
 MD5=0fbf1414f026ad10e76acfc03175b37a

Keep in mind that the difference may be due to the QP information
missing in mp=pp7. So you should focus on that (try to reset/disable
qp processing in pp7 and see if it works the same as mp=pp7).
-- 
FFmpeg = Foolish and Frenzy Mystic Puritan Elitist Geisha
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi: Port mp=pp7 to libavfilter

2014-12-29 Thread Stefano Sabatini
On date Sunday 2014-12-28 19:45:18 +0530, arwa arif encoded:
[...]
 From ebf5f36d9e9fc80264bb605dfee5c09cbf1f10ef Mon Sep 17 00:00:00 2001
 From: Arwa Arif arwaarif1...@gmail.com
 Date: Thu, 25 Dec 2014 09:50:24 +0530
 Subject: [PATCH] lavfi: port mp=pp7 to avfilter
 

 Added use_bframe_qp in the list of options.

Also, add use_bframe_qp option.

I'd also suggest to implement this on top of the port.

 TODO: modify version.h, Add ff_norm_qscale in internal.h
 ---
  LICENSE.md   |1 +
  configure|1 +
  doc/filters.texi |   31 
  libavfilter/Makefile |1 +
  libavfilter/allfilters.c |1 +
  libavfilter/vf_pp7.c |  460 
 ++
  libavfilter/vf_pp7.h |   49 +
  libavfilter/x86/Makefile |1 +
  libavfilter/x86/vf_pp7.c |   68 +++
  9 files changed, 613 insertions(+)
  create mode 100644 libavfilter/vf_pp7.c
  create mode 100644 libavfilter/vf_pp7.h
  create mode 100644 libavfilter/x86/vf_pp7.c

[...]

It is not bitexact here.

ffmpeg -i matrixbench_mpeg2-lq.mpg -vf mp=pp7=30 -t 2 -f md5 -
[...]
MD5=b281d6e4c077f4bf992dae262bc1cd3e

ffmpeg -i matrixbench_mpeg2-lq.mpg -vf pp7=30 -t 2 -f md5 -
[...]
MD5=0fbf1414f026ad10e76acfc03175b37a
-- 
FFmpeg = Fancy and Fanciful Maxi Plastic Educated Gadget
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi: Port mp=pp7 to libavfilter

2014-12-28 Thread arwa arif


 Are you sure? I get this:
 libavfilter/filtfmts-test mp pp7
 [...]
 INPUT[0] default: fmt:gray
 INPUT[0] default: fmt:yuv410p
 INPUT[0] default: fmt:yuv420p
 INPUT[0] default: fmt:yuv411p
 INPUT[0] default: fmt:yuv422p
 INPUT[0] default: fmt:yuv444p
 INPUT[0] default: fmt:yuvj420p
 INPUT[0] default: fmt:yuvj422p
 INPUT[0] default: fmt:yuvj444p
 OUTPUT[0] default: fmt:gray
 OUTPUT[0] default: fmt:yuv410p
 OUTPUT[0] default: fmt:yuv420p
 OUTPUT[0] default: fmt:yuv411p
 OUTPUT[0] default: fmt:yuv422p
 OUTPUT[0] default: fmt:yuv444p
 OUTPUT[0] default: fmt:yuvj420p
 OUTPUT[0] default: fmt:yuvj422p
 OUTPUT[0] default: fmt:yuvj444p


I don't get the same result (the order is different. Does the order
matter?).


 --
 FFmpeg = Freak  Funny Minimalistic Political Elfic Glue
 ___
 ffmpeg-devel mailing list
 ffmpeg-devel@ffmpeg.org
 http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

From ebf5f36d9e9fc80264bb605dfee5c09cbf1f10ef Mon Sep 17 00:00:00 2001
From: Arwa Arif arwaarif1...@gmail.com
Date: Thu, 25 Dec 2014 09:50:24 +0530
Subject: [PATCH] lavfi: port mp=pp7 to avfilter

Added use_bframe_qp in the list of options.

TODO: modify version.h, Add ff_norm_qscale in internal.h
---
 LICENSE.md   |1 +
 configure|1 +
 doc/filters.texi |   31 
 libavfilter/Makefile |1 +
 libavfilter/allfilters.c |1 +
 libavfilter/vf_pp7.c |  460 ++
 libavfilter/vf_pp7.h |   49 +
 libavfilter/x86/Makefile |1 +
 libavfilter/x86/vf_pp7.c |   68 +++
 9 files changed, 613 insertions(+)
 create mode 100644 libavfilter/vf_pp7.c
 create mode 100644 libavfilter/vf_pp7.h
 create mode 100644 libavfilter/x86/vf_pp7.c

diff --git a/LICENSE.md b/LICENSE.md
index 5659973..e612c22 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -43,6 +43,7 @@ Specifically, the GPL parts of FFmpeg are:
 - vf_perspective.c
 - vf_phase.c
 - vf_pp.c
+- vf_pp7.c
 - vf_pullup.c
 - vf_sab.c
 - vf_smartblur.c
diff --git a/configure b/configure
index 9085200..c73562b 100755
--- a/configure
+++ b/configure
@@ -2597,6 +2597,7 @@ mpdecimate_filter_select=pixelutils
 mptestsrc_filter_deps=gpl
 negate_filter_deps=lut_filter
 perspective_filter_deps=gpl
+pp7_filter_deps=gpl
 ocv_filter_deps=libopencv
 owdenoise_filter_deps=gpl
 pan_filter_deps=swresample
diff --git a/doc/filters.texi b/doc/filters.texi
index aa8bb61..428785e 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -7171,6 +7171,37 @@ pp=hb|y/vb|a
 @end example
 @end itemize
 
+@section pp7
+Apply Postprocessing filter 7. It is variant of the @ref{spp} filter,
+similar to spp = 6 with 7 point DCT, where only the center sample is
+used after IDCT.
+
+The filter accepts the following options:
+
+@table @option
+@item qp
+Force a constant quantization parameter. It accepts an integer in range
+0 to 63. If not set, the filter will use the QP from the video stream
+(if available).
+
+@item mode
+Set thresholding mode. Available modes are:
+
+@table @samp
+@item hard
+Set hard thresholding.
+@item soft
+Set soft thresholding (better de-ringing effect, but likely blurrier).
+@item medium
+Set medium thresholding (good results, default).
+@end table
+
+@item use_bframe_qp
+Enable the use of the QP from the B-Frames if set to @code{1}. Using this
+option may cause flicker since the B-Frames have often larger QP. Default is
+@code{0} (not enabled).
+@end table
+
 @section psnr
 
 Obtain the average, maximum and minimum PSNR (Peak Signal to Noise
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index cdcbe0a..8fcb270 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -164,6 +164,7 @@ OBJS-$(CONFIG_PERSPECTIVE_FILTER)+= vf_perspective.o
 OBJS-$(CONFIG_PHASE_FILTER)  += vf_phase.o
 OBJS-$(CONFIG_PIXDESCTEST_FILTER)+= vf_pixdesctest.o
 OBJS-$(CONFIG_PP_FILTER) += vf_pp.o
+OBJS-$(CONFIG_PP7_FILTER)+= vf_pp7.o
 OBJS-$(CONFIG_PSNR_FILTER)   += vf_psnr.o dualinput.o framesync.o
 OBJS-$(CONFIG_PULLUP_FILTER) += vf_pullup.o
 OBJS-$(CONFIG_REMOVELOGO_FILTER) += bbox.o lswsutils.o lavfutils.o vf_removelogo.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 2911ed9..381da4f 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -179,6 +179,7 @@ void avfilter_register_all(void)
 REGISTER_FILTER(PHASE,  phase,  vf);
 REGISTER_FILTER(PIXDESCTEST,pixdesctest,vf);
 REGISTER_FILTER(PP, pp, vf);
+REGISTER_FILTER(PP7,pp7,vf);
 REGISTER_FILTER(PSNR,   psnr,   vf);
 REGISTER_FILTER(PULLUP, pullup, vf);
 REGISTER_FILTER(REMOVELOGO, removelogo, vf);
diff --git a/libavfilter/vf_pp7.c b/libavfilter/vf_pp7.c
new file mode 100644
index 

Re: [FFmpeg-devel] [PATCH] lavfi: Port mp=pp7 to libavfilter

2014-12-28 Thread Michael Niedermayer
On Sun, Dec 28, 2014 at 07:45:18PM +0530, arwa arif wrote:
 
 
  Are you sure? I get this:
  libavfilter/filtfmts-test mp pp7
  [...]
  INPUT[0] default: fmt:gray
  INPUT[0] default: fmt:yuv410p
  INPUT[0] default: fmt:yuv420p
  INPUT[0] default: fmt:yuv411p
  INPUT[0] default: fmt:yuv422p
  INPUT[0] default: fmt:yuv444p
  INPUT[0] default: fmt:yuvj420p
  INPUT[0] default: fmt:yuvj422p
  INPUT[0] default: fmt:yuvj444p
  OUTPUT[0] default: fmt:gray
  OUTPUT[0] default: fmt:yuv410p
  OUTPUT[0] default: fmt:yuv420p
  OUTPUT[0] default: fmt:yuv411p
  OUTPUT[0] default: fmt:yuv422p
  OUTPUT[0] default: fmt:yuv444p
  OUTPUT[0] default: fmt:yuvj420p
  OUTPUT[0] default: fmt:yuvj422p
  OUTPUT[0] default: fmt:yuvj444p
 
 
 I don't get the same result (the order is different. Does the order
 matter?).

the order is irrelevant

patch loos good to me

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi: Port mp=pp7 to libavfilter

2014-12-27 Thread arwa arif


  ...]
   +static int query_formats(AVFilterContext *ctx)
   +{
   +static const enum PixelFormat pix_fmts[] = {
   +AV_PIX_FMT_YUV444P,  AV_PIX_FMT_YUV422P,
   +AV_PIX_FMT_YUV420P,  AV_PIX_FMT_YUV411P,
   +AV_PIX_FMT_YUV410P,  AV_PIX_FMT_YUV440P,
   +AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P,
   +AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ440P,
   +AV_PIX_FMT_NONE
   +};
   +ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
   +return 0;
   +}
 
  Check that these are supported. Also the original is supporting some
  more formats (for example GRAY8 == Y8).
 
  How do I check it?

 make libavfilter/filtfmts-test
 libavfilter/filtfmts-test mp pp7


I am getting this as output:

INPUT[0] default: fmt:yuv444p
INPUT[0] default: fmt:yuv422p
INPUT[0] default: fmt:yuv420p
INPUT[0] default: fmt:yuv411p
INPUT[0] default: fmt:yuv410p
INPUT[0] default: fmt:yuv440p
INPUT[0] default: fmt:yuvj444p
INPUT[0] default: fmt:yuvj422p
INPUT[0] default: fmt:yuvj420p
INPUT[0] default: fmt:yuvj440p
OUTPUT[0] default: fmt:yuv444p
OUTPUT[0] default: fmt:yuv422p
OUTPUT[0] default: fmt:yuv420p
OUTPUT[0] default: fmt:yuv411p
OUTPUT[0] default: fmt:yuv410p
OUTPUT[0] default: fmt:yuv440p
OUTPUT[0] default: fmt:yuvj444p
OUTPUT[0] default: fmt:yuvj422p
OUTPUT[0] default: fmt:yuvj420p
OUTPUT[0] default: fmt:yuvj440p


[...]
 --
 FFmpeg = Friendly Fundamentalist Multimedia Power Educated Guru
 ___
 ffmpeg-devel mailing list
 ffmpeg-devel@ffmpeg.org
 http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

From bc3416e14efc5f32d4c8904e54a53afd26fc74d2 Mon Sep 17 00:00:00 2001
From: Arwa Arif arwaarif1...@gmail.com
Date: Thu, 25 Dec 2014 09:50:24 +0530
Subject: [PATCH] lavfi: port mp=pp7 to avfilter

Added use_bframe_qp in the list of options.

TODO: modify version.h
---
 LICENSE.md   |1 +
 configure|1 +
 doc/filters.texi |   31 
 libavfilter/Makefile |1 +
 libavfilter/allfilters.c |1 +
 libavfilter/vf_pp7.c |  462 ++
 libavfilter/vf_pp7.h |   49 +
 libavfilter/x86/Makefile |1 +
 libavfilter/x86/vf_pp7.c |   68 +++
 9 files changed, 615 insertions(+)
 create mode 100644 libavfilter/vf_pp7.c
 create mode 100644 libavfilter/vf_pp7.h
 create mode 100644 libavfilter/x86/vf_pp7.c

diff --git a/LICENSE.md b/LICENSE.md
index 5659973..e612c22 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -43,6 +43,7 @@ Specifically, the GPL parts of FFmpeg are:
 - vf_perspective.c
 - vf_phase.c
 - vf_pp.c
+- vf_pp7.c
 - vf_pullup.c
 - vf_sab.c
 - vf_smartblur.c
diff --git a/configure b/configure
index 9085200..c73562b 100755
--- a/configure
+++ b/configure
@@ -2597,6 +2597,7 @@ mpdecimate_filter_select=pixelutils
 mptestsrc_filter_deps=gpl
 negate_filter_deps=lut_filter
 perspective_filter_deps=gpl
+pp7_filter_deps=gpl
 ocv_filter_deps=libopencv
 owdenoise_filter_deps=gpl
 pan_filter_deps=swresample
diff --git a/doc/filters.texi b/doc/filters.texi
index aa8bb61..428785e 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -7171,6 +7171,37 @@ pp=hb|y/vb|a
 @end example
 @end itemize
 
+@section pp7
+Apply Postprocessing filter 7. It is variant of the @ref{spp} filter,
+similar to spp = 6 with 7 point DCT, where only the center sample is
+used after IDCT.
+
+The filter accepts the following options:
+
+@table @option
+@item qp
+Force a constant quantization parameter. It accepts an integer in range
+0 to 63. If not set, the filter will use the QP from the video stream
+(if available).
+
+@item mode
+Set thresholding mode. Available modes are:
+
+@table @samp
+@item hard
+Set hard thresholding.
+@item soft
+Set soft thresholding (better de-ringing effect, but likely blurrier).
+@item medium
+Set medium thresholding (good results, default).
+@end table
+
+@item use_bframe_qp
+Enable the use of the QP from the B-Frames if set to @code{1}. Using this
+option may cause flicker since the B-Frames have often larger QP. Default is
+@code{0} (not enabled).
+@end table
+
 @section psnr
 
 Obtain the average, maximum and minimum PSNR (Peak Signal to Noise
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index cdcbe0a..8fcb270 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -164,6 +164,7 @@ OBJS-$(CONFIG_PERSPECTIVE_FILTER)+= vf_perspective.o
 OBJS-$(CONFIG_PHASE_FILTER)  += vf_phase.o
 OBJS-$(CONFIG_PIXDESCTEST_FILTER)+= vf_pixdesctest.o
 OBJS-$(CONFIG_PP_FILTER) += vf_pp.o
+OBJS-$(CONFIG_PP7_FILTER)+= vf_pp7.o
 OBJS-$(CONFIG_PSNR_FILTER)   += vf_psnr.o dualinput.o framesync.o
 OBJS-$(CONFIG_PULLUP_FILTER) += vf_pullup.o
 OBJS-$(CONFIG_REMOVELOGO_FILTER) += bbox.o lswsutils.o lavfutils.o vf_removelogo.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 

Re: [FFmpeg-devel] [PATCH] lavfi: Port mp=pp7 to libavfilter

2014-12-27 Thread Michael Niedermayer
On Sat, Dec 27, 2014 at 06:07:53PM +0530, arwa arif wrote:
[...]
 +#define OFFSET(x) offsetof(PP7Context, x)
 +#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 +static const AVOption pp7_options[] = {
 +{ qp, force a constant quantizer parameter, OFFSET(qp), 
 AV_OPT_TYPE_INT, {.i64 = 0}, 0, 64, FLAGS },
 +{ mode, set thresholding mode, OFFSET(mode), AV_OPT_TYPE_INT, {.i64 
 = MODE_MEDIUM}, 0, 2, FLAGS, mode },
 +{ hard,   hard thresholding,   0, AV_OPT_TYPE_CONST, {.i64 = 
 MODE_HARD},   INT_MIN, INT_MAX, FLAGS, mode },
 +{ soft,   soft thresholding,   0, AV_OPT_TYPE_CONST, {.i64 = 
 MODE_SOFT},   INT_MIN, INT_MAX, FLAGS, mode },
 +{ medium, medium thresholding, 0, AV_OPT_TYPE_CONST, {.i64 = 
 MODE_MEDIUM}, INT_MIN, INT_MAX, FLAGS, mode },
 +{ use_bframe_qp, use B-frames' QP, OFFSET(use_bframe_qp), 
 AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, FLAGS },
 +{ NULL }
 +};
 +
 +AVFILTER_DEFINE_CLASS(pp7);
 +

 +#if HAVE_MMX_INLINE
 +DECLARE_ALIGNED(8, static const uint8_t, dither)[8][8] = {

dither is used outside HAVE_MMX_INLINE code, it thus cannot be
under HAVE_MMX_INLINE or build would break on non-x86 platforms


 +{  0,  48,  12,  60,   3,  51,  15,  63, },
 +{ 32,  16,  44,  28,  35,  19,  47,  31, },
 +{  8,  56,   4,  52,  11,  59,   7,  55, },
 +{ 40,  24,  36,  20,  43,  27,  39,  23, },
 +{  2,  50,  14,  62,   1,  49,  13,  61, },
 +{ 34,  18,  46,  30,  33,  17,  45,  29, },
 +{ 10,  58,   6,  54,   9,  57,   5,  53, },
 +{ 42,  26,  38,  22,  41,  25,  37,  21, },
 +};
 +#endif


[...]
 diff --git a/libavfilter/x86/vf_pp7.c b/libavfilter/x86/vf_pp7.c
 new file mode 100644
 index 000..fe33d7f
 --- /dev/null
 +++ b/libavfilter/x86/vf_pp7.c
 @@ -0,0 +1,68 @@
 +/*
 + * Copyright (c) 2005 Michael Niedermayer michae...@gmx.at
 + *
 + * This file is part of FFmpeg.
 + *
 + * FFmpeg is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License as published by
 + * the Free Software Foundation; either version 2 of the License, or
 + * (at your option) any later version.
 + *
 + * FFmpeg is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public License along
 + * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
 + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 + */
 +
 +#include libavutil/attributes.h
 +#include libavutil/cpu.h
 +#include libavutil/mem.h
 +#include libavutil/x86/asm.h
 +#include libavfilter/vf_pp7.h
 +
 +static void dctB_mmx(int16_t *dst, int16_t *src)
 +{
 +__asm__ volatile (
 +movq  (%0), %%mm0  \n\t
 +movq  1*4*2(%0), %%mm1 \n\t
 +paddw 6*4*2(%0), %%mm0 \n\t
 +paddw 5*4*2(%0), %%mm1 \n\t
 +movq  2*4*2(%0), %%mm2 \n\t
 +movq  3*4*2(%0), %%mm3 \n\t
 +paddw 4*4*2(%0), %%mm2 \n\t
 +paddw %%mm3, %%mm3 \n\t //s
 +movq %%mm3, %%mm4  \n\t //s
 +psubw %%mm0, %%mm3 \n\t //s-s0
 +paddw %%mm0, %%mm4 \n\t //s+s0
 +movq %%mm2, %%mm0  \n\t //s2
 +psubw %%mm1, %%mm2 \n\t //s2-s1
 +paddw %%mm1, %%mm0 \n\t //s2+s1
 +movq %%mm4, %%mm1  \n\t //s0'
 +psubw %%mm0, %%mm4 \n\t //s0'-s'
 +paddw %%mm0, %%mm1 \n\t //s0'+s'
 +movq %%mm3, %%mm0  \n\t //s3'
 +psubw %%mm2, %%mm3 \n\t
 +psubw %%mm2, %%mm3 \n\t
 +paddw %%mm0, %%mm2 \n\t
 +paddw %%mm0, %%mm2 \n\t
 +movq %%mm1, (%1)   \n\t
 +movq %%mm4, 2*4*2(%1)  \n\t
 +movq %%mm2, 1*4*2(%1)  \n\t
 +movq %%mm3, 3*4*2(%1)  \n\t
 +:: r (src), r(dst)
 +);
 +}
 +
 +av_cold void ff_pp7_init_x86(PP7Context *p)
 +{

 +#if HAVE_MMX_INLINE
 +int cpu_flags = av_get_cpu_flags();
 +
 +if (HAVE_MMX_INLINE  cpu_flags  AV_CPU_FLAG_MMX)
 +p-dctB = dctB_mmx;
 +#endif

the 2 HAVE_MMX_INLINE are redundant relative to each other

also the actual asm should possibly be under HAVE_MMX_INLINE as well

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi: Port mp=pp7 to libavfilter

2014-12-27 Thread Stefano Sabatini
On date Saturday 2014-12-27 18:07:53 +0530, arwa arif encoded:
 
 
   ...]
+static int query_formats(AVFilterContext *ctx)
+{
+static const enum PixelFormat pix_fmts[] = {
+AV_PIX_FMT_YUV444P,  AV_PIX_FMT_YUV422P,
+AV_PIX_FMT_YUV420P,  AV_PIX_FMT_YUV411P,
+AV_PIX_FMT_YUV410P,  AV_PIX_FMT_YUV440P,
+AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P,
+AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ440P,
+AV_PIX_FMT_NONE
+};
+ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
+return 0;
+}
  
   Check that these are supported. Also the original is supporting some
   more formats (for example GRAY8 == Y8).
  
   How do I check it?
 
  make libavfilter/filtfmts-test
  libavfilter/filtfmts-test mp pp7
 
 
 I am getting this as output:
 
 INPUT[0] default: fmt:yuv444p
 INPUT[0] default: fmt:yuv422p
 INPUT[0] default: fmt:yuv420p
 INPUT[0] default: fmt:yuv411p
 INPUT[0] default: fmt:yuv410p
 INPUT[0] default: fmt:yuv440p
 INPUT[0] default: fmt:yuvj444p
 INPUT[0] default: fmt:yuvj422p
 INPUT[0] default: fmt:yuvj420p
 INPUT[0] default: fmt:yuvj440p
 OUTPUT[0] default: fmt:yuv444p
 OUTPUT[0] default: fmt:yuv422p
 OUTPUT[0] default: fmt:yuv420p
 OUTPUT[0] default: fmt:yuv411p
 OUTPUT[0] default: fmt:yuv410p
 OUTPUT[0] default: fmt:yuv440p
 OUTPUT[0] default: fmt:yuvj444p
 OUTPUT[0] default: fmt:yuvj422p
 OUTPUT[0] default: fmt:yuvj420p
 OUTPUT[0] default: fmt:yuvj440p

Are you sure? I get this:
libavfilter/filtfmts-test mp pp7
[...]
INPUT[0] default: fmt:gray
INPUT[0] default: fmt:yuv410p
INPUT[0] default: fmt:yuv420p
INPUT[0] default: fmt:yuv411p
INPUT[0] default: fmt:yuv422p
INPUT[0] default: fmt:yuv444p
INPUT[0] default: fmt:yuvj420p
INPUT[0] default: fmt:yuvj422p
INPUT[0] default: fmt:yuvj444p
OUTPUT[0] default: fmt:gray
OUTPUT[0] default: fmt:yuv410p
OUTPUT[0] default: fmt:yuv420p
OUTPUT[0] default: fmt:yuv411p
OUTPUT[0] default: fmt:yuv422p
OUTPUT[0] default: fmt:yuv444p
OUTPUT[0] default: fmt:yuvj420p
OUTPUT[0] default: fmt:yuvj422p
OUTPUT[0] default: fmt:yuvj444p
-- 
FFmpeg = Freak  Funny Minimalistic Political Elfic Glue
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi: Port mp=pp7 to libavfilter

2014-12-25 Thread Carl Eugen Hoyos
arwa arif arwaarif1994 at gmail.com writes:

  +static const enum PixelFormat pix_fmts[] = {
  +AV_PIX_FMT_YUV444P,  AV_PIX_FMT_YUV422P,
  +AV_PIX_FMT_YUV420P,  AV_PIX_FMT_YUV411P,
  +AV_PIX_FMT_YUV410P,  AV_PIX_FMT_YUV440P,
  +AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P,
  +AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ440P,

 Check that these are supported. Also the original is 
 supporting some more formats (for example GRAY8 == Y8).
 
 How do I check it?

Run ffmpeg with your patch attached and test if above 
pix_fmts all work and consider to compare with mp=pp7.
From a quick comparison with the mp filter, they should 
work, but at least 440 should be tested and gray is 
missing.

Merry Christmas, Carl Eugen

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi: Port mp=pp7 to libavfilter

2014-12-25 Thread Stefano Sabatini
On date Thursday 2014-12-25 21:50:03 +0530, arwa arif encoded:
  +#include libavutil/avassert.h
  +#include libavutil/imgutils.h
  +#include libavutil/opt.h
  +#include libavutil/pixdesc.h
  +#include internal.h
  +#include libavcodec/avcodec.h //for reference to FF_QSCALE_TYPE
  +#include vf_pp7.h
  +
  +enum mode {
  +MODE_HARD,
  +MODE_SOFT,
  +MODE_MEDIUM
  +};
  +
  +#define OFFSET(x) offsetof(PP7Context, x)
  +#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
  +static const AVOption pp7_options[] = {
  +{ qp, force a constant quantizer parameter, OFFSET(qp),
 AV_OPT_TYPE_INT, {.i64 = 0}, 0, 64, FLAGS },
  +{ mode, set thresholding mode, OFFSET(mode), AV_OPT_TYPE_INT,
 {.i64 = MODE_MEDIUM}, 0, 2, FLAGS, mode },
  +{ hard,   hard thresholding,   0, AV_OPT_TYPE_CONST, {.i64 =
 MODE_HARD},   INT_MIN, INT_MAX, FLAGS, mode },
  +{ soft,   soft thresholding,   0, AV_OPT_TYPE_CONST, {.i64 =
 MODE_SOFT},   INT_MIN, INT_MAX, FLAGS, mode },
  +{ medium, medium thresholding, 0, AV_OPT_TYPE_CONST, {.i64 =
 MODE_MEDIUM}, INT_MIN, INT_MAX, FLAGS, mode },
 
  +{ use_bframe_qp, use B-frames' QP, OFFSET(use_bframe_qp),
 AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, FLAGS },
 
 This parameter is not present in the original code, mention this in
 the log (alternatively you could add it in a separate commit).
 
 Which log should I mention it in?

The commit log.
 
 ...]
  +static int query_formats(AVFilterContext *ctx)
  +{
  +static const enum PixelFormat pix_fmts[] = {
  +AV_PIX_FMT_YUV444P,  AV_PIX_FMT_YUV422P,
  +AV_PIX_FMT_YUV420P,  AV_PIX_FMT_YUV411P,
  +AV_PIX_FMT_YUV410P,  AV_PIX_FMT_YUV440P,
  +AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P,
  +AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ440P,
  +AV_PIX_FMT_NONE
  +};
  +ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
  +return 0;
  +}
 
 Check that these are supported. Also the original is supporting some
 more formats (for example GRAY8 == Y8).
 
 How do I check it?

make libavfilter/filtfmts-test
libavfilter/filtfmts-test mp pp7
 
 
 Updated the patch.

 From 9825b546c9feef607b959c080fcc11a9244b4c9d Mon Sep 17 00:00:00 2001
 From: Arwa Arif arwaarif1...@gmail.com
 Date: Thu, 25 Dec 2014 09:50:24 +0530
 Subject: [PATCH] lavfi: port mp=pp7 to avfilter
 

 internal.h: Add ff_norm_qscale

please move this change to a separate commit

 TODO: modify version.h
 ---
  LICENSE.md   |1 +
  configure|1 +
  doc/filters.texi |   31 +++
  libavfilter/Makefile |1 +
  libavfilter/allfilters.c |1 +
  libavfilter/internal.h   |   15 ++
  libavfilter/vf_pp7.c |  497 
 ++
  libavfilter/vf_pp7.h |   49 +
  libavfilter/x86/Makefile |1 +
  libavfilter/x86/vf_pp7.c |   74 +++
  10 files changed, 671 insertions(+)
  create mode 100644 libavfilter/vf_pp7.c
  create mode 100644 libavfilter/vf_pp7.h
  create mode 100644 libavfilter/x86/vf_pp7.c
 
 diff --git a/LICENSE.md b/LICENSE.md
 index 5659973..e612c22 100644
 --- a/LICENSE.md
 +++ b/LICENSE.md
 @@ -43,6 +43,7 @@ Specifically, the GPL parts of FFmpeg are:
  - vf_perspective.c
  - vf_phase.c
  - vf_pp.c
 +- vf_pp7.c
  - vf_pullup.c
  - vf_sab.c
  - vf_smartblur.c
 diff --git a/configure b/configure
 index 9085200..c73562b 100755
 --- a/configure
 +++ b/configure
 @@ -2597,6 +2597,7 @@ mpdecimate_filter_select=pixelutils
  mptestsrc_filter_deps=gpl
  negate_filter_deps=lut_filter
  perspective_filter_deps=gpl
 +pp7_filter_deps=gpl
  ocv_filter_deps=libopencv
  owdenoise_filter_deps=gpl
  pan_filter_deps=swresample
 diff --git a/doc/filters.texi b/doc/filters.texi
 index aa8bb61..428785e 100644
 --- a/doc/filters.texi
 +++ b/doc/filters.texi
 @@ -7171,6 +7171,37 @@ pp=hb|y/vb|a
  @end example
  @end itemize
  
 +@section pp7
 +Apply Postprocessing filter 7. It is variant of the @ref{spp} filter,
 +similar to spp = 6 with 7 point DCT, where only the center sample is
 +used after IDCT.
 +
 +The filter accepts the following options:
 +
 +@table @option
 +@item qp
 +Force a constant quantization parameter. It accepts an integer in range
 +0 to 63. If not set, the filter will use the QP from the video stream
 +(if available).
 +
 +@item mode
 +Set thresholding mode. Available modes are:
 +
 +@table @samp
 +@item hard
 +Set hard thresholding.
 +@item soft
 +Set soft thresholding (better de-ringing effect, but likely blurrier).
 +@item medium
 +Set medium thresholding (good results, default).
 +@end table
 +
 +@item use_bframe_qp
 +Enable the use of the QP from the B-Frames if set to @code{1}. Using this
 +option may cause flicker since the B-Frames have often larger QP. Default is
 +@code{0} (not enabled).
 +@end table
 +
  @section psnr
  
  Obtain the average, maximum and minimum PSNR (Peak Signal to Noise
 diff --git a/libavfilter/Makefile b/libavfilter/Makefile
 index