Hi,

On Thu, Apr 28, 2011 at 4:06 PM, Ronald S. Bultje <[email protected]> wrote:
> On Thu, Apr 28, 2011 at 3:11 PM, Ronald S. Bultje <[email protected]> wrote:
>> On Thu, Apr 28, 2011 at 2:36 PM, Justin Ruggles
>> <[email protected]> wrote:
>>> The EMU_EDGE part looks correct.  We should go ahead and commit that.
>>
>> Did you confirm that it does not introduce valgrind errors when
>> running ffmpeg -flags emu_edge -i file.amv -f null -?
>
> after removing that EMU_EDGE line from my checkout:
>
> dhcp-172-22-79-131:x86-64-gpl rbultje$ ./ffmpeg -i
> /Users/rbultje/Movies/fate-suite/amv/MTV_high_res_320x240_sample_Penguin_Joke_MTV_from_WMV.amv
> -f md5 -v 0 - 2>&1 | grep ^MD5
> MD5=0af163b81afd2e176b1e4f53f53b94f2
> dhcp-172-22-79-131:x86-64-gpl rbultje$ ./ffmpeg -flags emu_edge -i
> /Users/rbultje/Movies/fate-suite/amv/MTV_high_res_320x240_sample_Penguin_Joke_MTV_from_WMV.amv
> -f md5 -v 0 - 2>&1 | grep ^MD5
> MD5=0626c4f3b03b16faa5dd3857421ceb95
>
> so the answer is that yes, it uses the edges, and we have to fix that,
> or error out on -flags emu_edge (like the vp8 decoder intiailly did).
> As such, the patch is not OK.

Oops, forgot to remove the emu-edge check in mjpegdec.c.


diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index fa2c505..40f92ed 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -800,10 +800,10 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb
         init_get_bits(&mb_bitmask_gb, mb_bitmask, s->mb_width*s->mb_height);
     }

-    if(s->flipped && s->avctx->flags & CODEC_FLAG_EMU_EDGE) {
-        av_log(s->avctx, AV_LOG_ERROR, "Can not flip image with CODEC_FLAG_EMU_
-        s->flipped = 0;
-    }
+    //if(s->flipped && s->avctx->flags & CODEC_FLAG_EMU_EDGE) {
+    //    av_log(s->avctx, AV_LOG_ERROR, "Can not flip image with CODEC_FLAG_EM
+    //    s->flipped = 0;
+    //}
     for(i=0; i < nb_components; i++) {
         int c = s->comp_index[i];
         data[c] = s->picture_ptr->data[c];
diff --git a/libavcodec/sp5xdec.c b/libavcodec/sp5xdec.c
index e2c371a..3bff825 100644
--- a/libavcodec/sp5xdec.c
+++ b/libavcodec/sp5xdec.c
@@ -86,7 +86,7 @@ static int sp5x_decode_frame(AVCodecContext *avctx,
     recoded[j++] = 0xFF;
     recoded[j++] = 0xD9;

-    avctx->flags &= ~CODEC_FLAG_EMU_EDGE;
+    //avctx->flags &= ~CODEC_FLAG_EMU_EDGE;
     av_init_packet(&avpkt_recoded);
     avpkt_recoded.data = recoded;
     avpkt_recoded.size = j;

That works for me and gives identical output for the two commands
earlier. If anyone can show me that there's no additional valgrind
errors between the two, patch OK.

Ronald
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to