Various optimized DSP functions read one line past the aligned picture.
Several ARMv6 put_pixels functions in HpelDSPContext load the input of
the next line while processing the current one. Explicitly allow this
for all codecs and not just H264.

Bug-Id: 646
CC: [email protected]
---
 libavcodec/utils.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index c88b346..a1de113 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -265,9 +265,12 @@ void avcodec_align_dimensions2(AVCodecContext *s, int 
*width, int *height,
 
     *width  = FFALIGN(*width, w_align);
     *height = FFALIGN(*height, h_align);
-    if (s->codec_id == AV_CODEC_ID_H264)
-        // some of the optimized chroma MC reads one line too much
-        *height += 2;
+
+    /* Some optimized dsp functions read one line too much (H264 chroma mc,
+     * ARM put_pixels functions, ...). Always add two lines so that subsampled
+     * chroma has also one additional line.
+     */
+    *height += 2;
 
     for (i = 0; i < 4; i++)
         linesize_align[i] = STRIDE_ALIGN;
-- 
1.9.0

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

Reply via email to