pjs/media/libvpx/variance-invoke.patch

102 строки
4.6 KiB
Diff

# HG changeset patch
# Parent f294d64ffb01bf6d8190377708405bf5f4fe30fa
# User Timothy B. Terriberry <tterribe@vt.edu>
Bug 730907 - Use VARIANCE_INVOKE in multiframe_quality_enhance_block()
diff --git a/media/libvpx/vp8/common/postproc.c b/media/libvpx/vp8/common/postproc.c
--- a/media/libvpx/vp8/common/postproc.c
+++ b/media/libvpx/vp8/common/postproc.c
@@ -706,17 +706,18 @@ static void multiframe_quality_enhance_b
unsigned char *u,
unsigned char *v,
int y_stride,
int uv_stride,
unsigned char *yd,
unsigned char *ud,
unsigned char *vd,
int yd_stride,
- int uvd_stride
+ int uvd_stride,
+ vp8_variance_rtcd_vtable_t *rtcd
)
{
static const unsigned char VP8_ZEROS[16]=
{
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
};
int blksizeby2 = blksize >> 1;
int qdiff = qcurr - qprev;
@@ -727,28 +728,28 @@ static void multiframe_quality_enhance_b
unsigned char *up;
unsigned char *udp;
unsigned char *vp;
unsigned char *vdp;
unsigned int act, sse, sad, thr;
if (blksize == 16)
{
- act = (vp8_variance_var16x16(yd, yd_stride, VP8_ZEROS, 0, &sse)+128)>>8;
- sad = (vp8_variance_sad16x16(y, y_stride, yd, yd_stride, 0)+128)>>8;
+ act = (VARIANCE_INVOKE(rtcd, var16x16)(yd, yd_stride, VP8_ZEROS, 0, &sse)+128)>>8;
+ sad = (VARIANCE_INVOKE(rtcd, sad16x16)(y, y_stride, yd, yd_stride, 0)+128)>>8;
}
else if (blksize == 8)
{
- act = (vp8_variance_var8x8(yd, yd_stride, VP8_ZEROS, 0, &sse)+32)>>6;
- sad = (vp8_variance_sad8x8(y, y_stride, yd, yd_stride, 0)+32)>>6;
+ act = (VARIANCE_INVOKE(rtcd, var8x8)(yd, yd_stride, VP8_ZEROS, 0, &sse)+32)>>6;
+ sad = (VARIANCE_INVOKE(rtcd, sad8x8)(y, y_stride, yd, yd_stride, 0)+32)>>6;
}
else
{
- act = (vp8_variance_var4x4(yd, yd_stride, VP8_ZEROS, 0, &sse)+8)>>4;
- sad = (vp8_variance_sad4x4(y, y_stride, yd, yd_stride, 0)+8)>>4;
+ act = (VARIANCE_INVOKE(rtcd, var4x4)(yd, yd_stride, VP8_ZEROS, 0, &sse)+8)>>4;
+ sad = (VARIANCE_INVOKE(rtcd, sad4x4)(y, y_stride, yd, yd_stride, 0)+8)>>4;
}
/* thr = qdiff/8 + log2(act) + log4(qprev) */
thr = (qdiff>>3);
while (act>>=1) thr++;
while (qprev>>=2) thr++;
if (sad < thr)
{
static const int roundoff = (1 << (MFQE_PRECISION - 1));
@@ -859,33 +860,35 @@ void vp8_multiframe_quality_enhance
u_ptr + 4*(i*show->uv_stride+j),
v_ptr + 4*(i*show->uv_stride+j),
show->y_stride,
show->uv_stride,
yd_ptr + 8*(i*dest->y_stride+j),
ud_ptr + 4*(i*dest->uv_stride+j),
vd_ptr + 4*(i*dest->uv_stride+j),
dest->y_stride,
- dest->uv_stride);
+ dest->uv_stride,
+ &cm->rtcd.variance);
}
else
{
multiframe_quality_enhance_block(16,
qcurr,
qprev,
y_ptr,
u_ptr,
v_ptr,
show->y_stride,
show->uv_stride,
yd_ptr,
ud_ptr,
vd_ptr,
dest->y_stride,
- dest->uv_stride);
+ dest->uv_stride,
+ &cm->rtcd.variance);
}
}
else
{
vp8_recon_copy16x16(y_ptr, show->y_stride, yd_ptr, dest->y_stride);
vp8_recon_copy8x8(u_ptr, show->uv_stride, ud_ptr, dest->uv_stride);
vp8_recon_copy8x8(v_ptr, show->uv_stride, vd_ptr, dest->uv_stride);