History

Merge "Overhauling the thresholds and mixing proportions for mfqe postprocessor."

Deb Mukherjee committed 14 years ago

Commit f357e5e2 parents ac97b08 47dcd761 file · +49 −45Browse files

Unified · Split

vp8/common/postproc.c+49−45
@@ -736,7 +736,7 @@ static void multiframe_quality_enhance_block · 735 unmodified lines
736 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0736 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
737 };737 };
738 int blksizeby2 = blksize >> 1;738 int blksizeby2 = blksize >> 1;
739 int blksizesq = blksize * blksize;739 int qdiff = qcurr - qprev;
740 740
741 int i, j;741 int i, j;
742 unsigned char *yp;742 unsigned char *yp;
@@ -749,27 +749,28 @@ static void multiframe_quality_enhance_block · 6 unmodified lines
749 unsigned int act, sse, sad, thr;749 unsigned int act, sse, sad, thr;
750 if (blksize == 16)750 if (blksize == 16)
751 {751 {
752 act = vp8_variance_var16x16(y, y_stride, VP8_ZEROS, 0, &sse);752 act = (vp8_variance_var16x16(yd, yd_stride, VP8_ZEROS, 0, &sse)+128)>>8;
753 sad = vp8_variance_sad16x16(y, y_stride, yd, yd_stride, 0);753 sad = (vp8_variance_sad16x16(y, y_stride, yd, yd_stride, 0)+128)>>8;
754 }754 }
755 else if (blksize == 8)755 else if (blksize == 8)
756 {756 {
757 act = vp8_variance_var8x8(y, y_stride, VP8_ZEROS, 0, &sse);757 act = (vp8_variance_var8x8(yd, yd_stride, VP8_ZEROS, 0, &sse)+32)>>6;
758 sad = vp8_variance_sad8x8(y, y_stride, yd, yd_stride, 0);758 sad = (vp8_variance_sad8x8(y, y_stride, yd, yd_stride, 0)+32)>>6;
759 }759 }
760 else760 else
761 {761 {
762 act = vp8_variance_var4x4(y, y_stride, VP8_ZEROS, 0, &sse);762 act = (vp8_variance_var4x4(yd, yd_stride, VP8_ZEROS, 0, &sse)+8)>>4;
763 sad = vp8_variance_sad4x4(y, y_stride, yd, yd_stride, 0);763 sad = (vp8_variance_sad4x4(y, y_stride, yd, yd_stride, 0)+8)>>4;
764 }764 }
765 765 /* thr = qdiff/8 + log2(act) + log4(qprev) */
766 thr = 6 * blksizesq + (act >> 3);766 thr = (qdiff>>3);
767 if (thr > 12 * blksizesq) thr = 12 * blksizesq;767 while (act>>=1) thr++;
768 // These thresholds should be adapted later based on qcurr and qprev768 while (qprev>>=2) thr++;
769 if (sad < thr)769 if (sad < thr)
770 {770 {
771 static const int roundoff = (1 << (MFQE_PRECISION - 1));771 static const int roundoff = (1 << (MFQE_PRECISION - 1));
772 int ifactor = (sad << MFQE_PRECISION) / thr;772 int ifactor = (sad << MFQE_PRECISION) / thr;
773 ifactor >>= (qdiff >> 5);
773 // TODO: SIMD optimize this section774 // TODO: SIMD optimize this section
774 if (ifactor)775 if (ifactor)
775 {776 {
@@ -861,41 +862,44 @@ void vp8_multiframe_quality_enhance · 85 unmodified lines
861 if (((frame_type == INTER_FRAME &&862 if (((frame_type == INTER_FRAME &&
862 abs(mode_info_context->mbmi.mv.as_mv.row) <= 10 &&863 abs(mode_info_context->mbmi.mv.as_mv.row) <= 10 &&
863 abs(mode_info_context->mbmi.mv.as_mv.col) <= 10) ||864 abs(mode_info_context->mbmi.mv.as_mv.col) <= 10) ||
864 (frame_type == KEY_FRAME)) &&865 (frame_type == KEY_FRAME)))
865 mode_info_context->mbmi.mode != B_PRED)
866 {
867 multiframe_quality_enhance_block(16,
868 qcurr,
869 qprev,
870 y_ptr,
871 u_ptr,
872 v_ptr,
873 show->y_stride,
874 show->uv_stride,
875 yd_ptr,
876 ud_ptr,
877 vd_ptr,
878 dest->y_stride,
879 dest->uv_stride);
880 }
881 else if (mode_info_context->mbmi.mode == B_PRED)
882 {866 {
883 int i, j;867 if (mode_info_context->mbmi.mode == B_PRED || mode_info_context->mbmi.mode == SPLITMV)
884 for (i=0; i<2; ++i)868 {
885 for (j=0; j<2; ++j)869 int i, j;
886 multiframe_quality_enhance_block(8,870 for (i=0; i<2; ++i)
887 qcurr,871 for (j=0; j<2; ++j)
888 qprev,872 multiframe_quality_enhance_block(8,
889 y_ptr + 8*(i*show->y_stride+j),873 qcurr,
890 u_ptr + 4*(i*show->uv_stride+j),874 qprev,
891 v_ptr + 4*(i*show->uv_stride+j),875 y_ptr + 8*(i*show->y_stride+j),
892 show->y_stride,876 u_ptr + 4*(i*show->uv_stride+j),
893 show->uv_stride,877 v_ptr + 4*(i*show->uv_stride+j),
894 yd_ptr + 8*(i*dest->y_stride+j),878 show->y_stride,
895 ud_ptr + 4*(i*dest->uv_stride+j),879 show->uv_stride,
896 vd_ptr + 4*(i*dest->uv_stride+j),880 yd_ptr + 8*(i*dest->y_stride+j),
897 dest->y_stride,881 ud_ptr + 4*(i*dest->uv_stride+j),
898 dest->uv_stride);882 vd_ptr + 4*(i*dest->uv_stride+j),
883 dest->y_stride,
884 dest->uv_stride);
885 }
886 else
887 {
888 multiframe_quality_enhance_block(16,
889 qcurr,
890 qprev,
891 y_ptr,
892 u_ptr,
893 v_ptr,
894 show->y_stride,
895 show->uv_stride,
896 yd_ptr,
897 ud_ptr,
898 vd_ptr,
899 dest->y_stride,
900 dest->uv_stride);
901
902 }
899 }903 }
900 else904 else
901 {905 {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t