[libav-devel] [PATCH] Tell RV10/20 decoder to use edge emulation.

2011-08-17 Thread Kostya Shishkov
This removes out-of-edge motion compensation artifacts (easily spotted green
blocks in avplay, gray blocks in transcoding), for example here:
http://samples.libav.org/samples/real/tv_watching_t1.rm
---
 libavcodec/rv10.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
index 3939984..d789eff 100644
--- a/libavcodec/rv10.c
+++ b/libavcodec/rv10.c
@@ -431,6 +431,7 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx)
 s-avctx= avctx;
 s-out_format = FMT_H263;
 s-codec_id= avctx-codec_id;
+avctx-flags |= CODEC_FLAG_EMU_EDGE;
 
 s-orig_width = s-width  = avctx-coded_width;
 s-orig_height= s-height = avctx-coded_height;
-- 
1.7.0.4

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] Tell RV10/20 decoder to use edge emulation.

2011-08-17 Thread Kostya
On Wed, Aug 17, 2011 at 01:33:07PM +0200, Luca Barbato wrote:
 On 8/17/11 10:36 AM, Kostya Shishkov wrote:
 This removes out-of-edge motion compensation artifacts (easily spotted green
 blocks in avplay, gray blocks in transcoding), for example here:
 http://samples.libav.org/samples/real/tv_watching_t1.rm
 ---
   libavcodec/rv10.c |1 +
   1 files changed, 1 insertions(+), 0 deletions(-)
 
 diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
 index 3939984..d789eff 100644
 --- a/libavcodec/rv10.c
 +++ b/libavcodec/rv10.c
 @@ -431,6 +431,7 @@ static av_cold int rv10_decode_init(AVCodecContext 
 *avctx)
   s-avctx= avctx;
   s-out_format = FMT_H263;
   s-codec_id= avctx-codec_id;
 +avctx-flags |= CODEC_FLAG_EMU_EDGE;
 
   s-orig_width = s-width  = avctx-coded_width;
   s-orig_height= s-height = avctx-coded_height;
 
 Is this patch depending on other? Seems fine.

No, it's independent.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] Tell RV10/20 decoder to use edge emulation.

2011-08-17 Thread Diego Biurrun
On Wed, Aug 17, 2011 at 01:47:31PM +0200, Kostya wrote:
 On Wed, Aug 17, 2011 at 01:33:07PM +0200, Luca Barbato wrote:
  On 8/17/11 10:36 AM, Kostya Shishkov wrote:
  This removes out-of-edge motion compensation artifacts (easily spotted 
  green
  blocks in avplay, gray blocks in transcoding), for example here:
  http://samples.libav.org/samples/real/tv_watching_t1.rm
  
  --- a/libavcodec/rv10.c
  +++ b/libavcodec/rv10.c
  @@ -431,6 +431,7 @@ static av_cold int rv10_decode_init(AVCodecContext 
  *avctx)
s-avctx= avctx;
s-out_format = FMT_H263;
s-codec_id= avctx-codec_id;
  +avctx-flags |= CODEC_FLAG_EMU_EDGE;
  
s-orig_width = s-width  = avctx-coded_width;
s-orig_height= s-height = avctx-coded_height;
  
  Is this patch depending on other? Seems fine.
 
 No, it's independent.

Queued.

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] Tell RV10/20 decoder to use edge emulation.

2011-08-17 Thread Ronald S. Bultje
Hi,

On Wed, Aug 17, 2011 at 1:36 AM, Kostya Shishkov
kostya.shish...@gmail.com wrote:
 This removes out-of-edge motion compensation artifacts (easily spotted green
 blocks in avplay, gray blocks in transcoding), for example here:
 http://samples.libav.org/samples/real/tv_watching_t1.rm
 ---
  libavcodec/rv10.c |    1 +
  1 files changed, 1 insertions(+), 0 deletions(-)

 diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
 index 3939984..d789eff 100644
 --- a/libavcodec/rv10.c
 +++ b/libavcodec/rv10.c
 @@ -431,6 +431,7 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx)
     s-avctx= avctx;
     s-out_format = FMT_H263;
     s-codec_id= avctx-codec_id;
 +    avctx-flags |= CODEC_FLAG_EMU_EDGE;

Why not just ignore CODEC_FLAG_EMU_EDGE presence during MC? I don't
like us overwriting user settings in AVCodecContext randomly. Some
apps may not expect that.

Ronald
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] Tell RV10/20 decoder to use edge emulation.

2011-08-17 Thread Kostya
On Wed, Aug 17, 2011 at 09:22:00AM -0700, Ronald S. Bultje wrote:
 Hi,
 
 On Wed, Aug 17, 2011 at 1:36 AM, Kostya Shishkov
 kostya.shish...@gmail.com wrote:
  This removes out-of-edge motion compensation artifacts (easily spotted green
  blocks in avplay, gray blocks in transcoding), for example here:
  http://samples.libav.org/samples/real/tv_watching_t1.rm
  ---
   libavcodec/rv10.c |    1 +
   1 files changed, 1 insertions(+), 0 deletions(-)
 
  diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
  index 3939984..d789eff 100644
  --- a/libavcodec/rv10.c
  +++ b/libavcodec/rv10.c
  @@ -431,6 +431,7 @@ static av_cold int rv10_decode_init(AVCodecContext 
  *avctx)
      s-avctx= avctx;
      s-out_format = FMT_H263;
      s-codec_id= avctx-codec_id;
  +    avctx-flags |= CODEC_FLAG_EMU_EDGE;
 
 Why not just ignore CODEC_FLAG_EMU_EDGE presence during MC? I don't
 like us overwriting user settings in AVCodecContext randomly. Some
 apps may not expect that.

If you want to delve into mpegvideo gut and fix it it would extremely good.
Other decoders (including e.g. VC-1 and 4XM) use the same trick too.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] Tell RV10/20 decoder to use edge emulation.

2011-08-17 Thread Måns Rullgård
Kostya Shishkov kostya.shish...@gmail.com writes:

 This removes out-of-edge motion compensation artifacts (easily spotted green
 blocks in avplay, gray blocks in transcoding), for example here:
 http://samples.libav.org/samples/real/tv_watching_t1.rm
 ---
  libavcodec/rv10.c |1 +
  1 files changed, 1 insertions(+), 0 deletions(-)

 diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
 index 3939984..d789eff 100644
 --- a/libavcodec/rv10.c
 +++ b/libavcodec/rv10.c
 @@ -431,6 +431,7 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx)
  s-avctx= avctx;
  s-out_format = FMT_H263;
  s-codec_id= avctx-codec_id;
 +avctx-flags |= CODEC_FLAG_EMU_EDGE;

  s-orig_width = s-width  = avctx-coded_width;
  s-orig_height= s-height = avctx-coded_height;
 -- 

Why does it not work *without* EMU_EDGE?  Usually it's the opposite.

-- 
Måns Rullgård
m...@mansr.com
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] Tell RV10/20 decoder to use edge emulation.

2011-08-17 Thread Ronald S. Bultje
Hi,

2011/8/17 Måns Rullgård m...@mansr.com:
 Kostya Shishkov kostya.shish...@gmail.com writes:

 This removes out-of-edge motion compensation artifacts (easily spotted green
 blocks in avplay, gray blocks in transcoding), for example here:
 http://samples.libav.org/samples/real/tv_watching_t1.rm
 ---
  libavcodec/rv10.c |    1 +
  1 files changed, 1 insertions(+), 0 deletions(-)

 diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
 index 3939984..d789eff 100644
 --- a/libavcodec/rv10.c
 +++ b/libavcodec/rv10.c
 @@ -431,6 +431,7 @@ static av_cold int rv10_decode_init(AVCodecContext 
 *avctx)
      s-avctx= avctx;
      s-out_format = FMT_H263;
      s-codec_id= avctx-codec_id;
 +    avctx-flags |= CODEC_FLAG_EMU_EDGE;

      s-orig_width = s-width  = avctx-coded_width;
      s-orig_height= s-height = avctx-coded_height;
 --

 Why does it not work *without* EMU_EDGE?  Usually it's the opposite.

I suppose it fails to call draw_edges()?

Ronald
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel