+            /* preserve the golden frame */
+            if (s->framep[VP56_FRAME_GOLDEN] == prev_frame) {
+                s->framep[VP56_FRAME_GOLDEN] = vp8_find_free_buffer(s);
+                if ((ret = vp8_alloc_frame(s,
s->framep[VP56_FRAME_GOLDEN], 1)) < 0)
+                   return ret;
+                copy_frame(s->framep[VP56_
FRAME_GOLDEN]->tf.f,
+                           prev_frame->tf.f, s->mb_width * 16,
+                           s->mb_height * 16);
+            }
+
+            for (j = 0; j < s->mb_height * 16; j++)
+                for (i = 0; i < s->mb_width * 16; i++) {
+                    uint8_t y = dst[j*linesize + i];
+                    dst[j*linesize + i] = av_clip_uint8(y + ((y *
beta) >> 8) + alpha);
+                }

Wouldn't it make more sense to combine the copy and weight into a
single operation?  This hits the same memory twice.

It also seems more natural for this to be split out into a DSP
function of some sort.

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

Reply via email to