[FFmpeg-devel] [RFC]Workaround for lowres crash on neon

Carl Eugen Hoyos cehoyos at ag.or.at
Wed May 29 15:36:02 CEST 2013


Hi!

Attached patch is an untested workaround for ticket #2538.

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c
index b630344..3baeafc 100644
--- a/libavcodec/h261dec.c
+++ b/libavcodec/h261dec.c
@@ -668,6 +668,10 @@ AVCodec ff_h261_decoder = {
     .close          = h261_decode_end,
     .decode         = h261_decode_frame,
     .capabilities   = CODEC_CAP_DR1,
+#if HAVE_NEON
+    .max_lowres     = 2,
+#else
     .max_lowres     = 3,
+#endif
     .long_name      = NULL_IF_CONFIG_SMALL("H.261"),
 };
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index bf9e072..448cebd 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -801,7 +801,11 @@ AVCodec ff_h263p_decoder = {
     .capabilities   = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 |
                       CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY,
     .flush          = ff_mpeg_flush,
+#if HAVE_NEON
+    .max_lowres     = 2,
+#else
     .max_lowres     = 3,
+#endif
     .long_name      = NULL_IF_CONFIG_SMALL("H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2"),
     .pix_fmts       = ff_h263_hwaccel_pixfmt_list_420,
 };
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index b5ef966..82172b8 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -2506,7 +2506,11 @@ AVCodec ff_mpeg1video_decoder = {
                              CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY |
                              CODEC_CAP_SLICE_THREADS,
     .flush                 = flush,
+#if HAVE_NEON
+    .max_lowres            = 2,
+#else
     .max_lowres            = 3,
+#endif
     .long_name             = NULL_IF_CONFIG_SMALL("MPEG-1 video"),
     .update_thread_context = ONLY_IF_THREADS_ENABLED(mpeg_decode_update_thread_context)
 };
@@ -2539,7 +2543,11 @@ AVCodec ff_mpegvideo_decoder = {
     .decode         = mpeg_decode_frame,
     .capabilities   = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS,
     .flush          = flush,
+#if HAVE_NEON
+    .max_lowres     = 2,
+#else
     .max_lowres     = 3,
+#endif
     .long_name      = NULL_IF_CONFIG_SMALL("MPEG-1 video"),
 };
 
diff --git a/libavcodec/msmpeg4dec.c b/libavcodec/msmpeg4dec.c
index 768b520..1cecd26 100644
--- a/libavcodec/msmpeg4dec.c
+++ b/libavcodec/msmpeg4dec.c
@@ -916,7 +916,11 @@ AVCodec ff_msmpeg4v1_decoder = {
     .close          = ff_h263_decode_end,
     .decode         = ff_h263_decode_frame,
     .capabilities   = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
+#if HAVE_NEON
+    .max_lowres     = 2,
+#else
     .max_lowres     = 3,
+#endif
     .long_name      = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 1"),
     .pix_fmts       = ff_pixfmt_list_420,
 };
@@ -930,7 +934,11 @@ AVCodec ff_msmpeg4v2_decoder = {
     .close          = ff_h263_decode_end,
     .decode         = ff_h263_decode_frame,
     .capabilities   = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
+#if HAVE_NEON
+    .max_lowres     = 2,
+#else
     .max_lowres     = 3,
+#endif
     .long_name      = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 2"),
     .pix_fmts       = ff_pixfmt_list_420,
 };
@@ -944,7 +952,11 @@ AVCodec ff_msmpeg4v3_decoder = {
     .close          = ff_h263_decode_end,
     .decode         = ff_h263_decode_frame,
     .capabilities   = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
+#if HAVE_NEON
+    .max_lowres     = 2,
+#else
     .max_lowres     = 3,
+#endif
     .long_name      = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 3"),
     .pix_fmts       = ff_pixfmt_list_420,
 };
diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
index 8d4f759..8e547f2 100644
--- a/libavcodec/rv10.c
+++ b/libavcodec/rv10.c
@@ -761,7 +761,11 @@ AVCodec ff_rv10_decoder = {
     .close          = rv10_decode_end,
     .decode         = rv10_decode_frame,
     .capabilities   = CODEC_CAP_DR1,
+#if HAVE_NEON
+    .max_lowres     = 2,
+#else
     .max_lowres     = 3,
+#endif
     .long_name      = NULL_IF_CONFIG_SMALL("RealVideo 1.0"),
     .pix_fmts       = ff_pixfmt_list_420,
 };


More information about the ffmpeg-devel mailing list