Verified Commit 53f47142 authored by Chun-Min Chang's avatar Chun-Min Chang Committed by ma1
Browse files

Bug 2047722 - Clamp the VP8 reference row await in ffvpx a=diannaS

Cherry-pick of FFmpeg commit b772f5033c72, carried as
vp8-reference-row-clamp.patch and listed in README_MOZILLA until ffvpx is
updated past it.

Original Revision: https://phabricator.services.mozilla.com/D315478

Differential Revision: https://phabricator.services.mozilla.com/D328288
parent 59434ea5
Loading
Loading
Loading
Loading
+3 −0
Changes for media/ffvpx/README_MOZILLA: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -151,3 +151,6 @@ Finally, apply the patches:
- vp9-flush-unref-next-refs.patch to clear VP9 frame-thread references on
  flush. Cherry-pick of FFmpeg commit a024f8c5413d, which is not in the 9.0
  release branch; drop this patch once ffvpx is updated past it.
- vp8-reference-row-clamp.patch to clamp the VP8 reference row await.
  Cherry-pick of FFmpeg commit b772f5033c72, which is not in the 9.0 release
  branch; drop this patch once ffvpx is updated past it.
+2 −2
Changes for media/ffvpx/libavcodec/vp8.c: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -1843,7 +1843,7 @@ void vp8_mc_luma(VP8Context *s, VP8ThreadData *td, uint8_t *dst,
        y_off += mv->y >> 2;

        // edge emulation
        ff_progress_frame_await(ref, (3 + y_off + block_h + subpel_idx[2][my]) >> 4);
        ff_progress_frame_await(ref, FFMAX((3 + y_off + block_h + subpel_idx[2][my]) >> 4, 0));
        src += y_off * linesize + x_off;
        if (x_off < mx_idx || x_off >= width  - block_w - subpel_idx[2][mx] ||
            y_off < my_idx || y_off >= height - block_h - subpel_idx[2][my]) {
@@ -1901,7 +1901,7 @@ void vp8_mc_chroma(VP8Context *s, VP8ThreadData *td, uint8_t *dst1,
        // edge emulation
        src1 += y_off * linesize + x_off;
        src2 += y_off * linesize + x_off;
        ff_progress_frame_await(ref, (3 + y_off + block_h + subpel_idx[2][my]) >> 3);
        ff_progress_frame_await(ref, FFMAX((3 + y_off + block_h + subpel_idx[2][my]) >> 3, 0));
        if (x_off < mx_idx || x_off >= width  - block_w - subpel_idx[2][mx] ||
            y_off < my_idx || y_off >= height - block_h - subpel_idx[2][my]) {
            s->vdsp.emulated_edge_mc(td->edge_emu_buffer,
+21 −0
Changes for media/ffvpx/vp8-reference-row-clamp.patch: 21 added lines, 0 removed lines.
Original line number Diff line number Diff line
diff --git a/media/ffvpx/libavcodec/vp8.c b/media/ffvpx/libavcodec/vp8.c
--- a/media/ffvpx/libavcodec/vp8.c
+++ b/media/ffvpx/libavcodec/vp8.c
@@ -1843,7 +1843,7 @@ void vp8_mc_luma(VP8Context *s, VP8ThreadData *td, uint8_t *dst,
         y_off += mv->y >> 2;

         // edge emulation
-        ff_progress_frame_await(ref, (3 + y_off + block_h + subpel_idx[2][my]) >> 4);
+        ff_progress_frame_await(ref, FFMAX((3 + y_off + block_h + subpel_idx[2][my]) >> 4, 0));
         src += y_off * linesize + x_off;
         if (x_off < mx_idx || x_off >= width  - block_w - subpel_idx[2][mx] ||
             y_off < my_idx || y_off >= height - block_h - subpel_idx[2][my]) {
@@ -1901,7 +1901,7 @@ void vp8_mc_chroma(VP8Context *s, VP8ThreadData *td, uint8_t *dst1,
         // edge emulation
         src1 += y_off * linesize + x_off;
         src2 += y_off * linesize + x_off;
-        ff_progress_frame_await(ref, (3 + y_off + block_h + subpel_idx[2][my]) >> 3);
+        ff_progress_frame_await(ref, FFMAX((3 + y_off + block_h + subpel_idx[2][my]) >> 3, 0));
         if (x_off < mx_idx || x_off >= width  - block_w - subpel_idx[2][mx] ||
             y_off < my_idx || y_off >= height - block_h - subpel_idx[2][my]) {
             s->vdsp.emulated_edge_mc(td->edge_emu_buffer,