Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: source/libvpx/vp8/encoder/onyx_if.c

Issue 11555023: libvpx: Add VP9 decoder. (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: source/libvpx/vp8/encoder/onyx_if.c
===================================================================
--- source/libvpx/vp8/encoder/onyx_if.c (revision 172621)
+++ source/libvpx/vp8/encoder/onyx_if.c (working copy)
@@ -10,6 +10,7 @@
#include "vpx_config.h"
+#include "./vpx_scale_rtcd.h"
#include "vp8/common/onyxc_int.h"
#include "vp8/common/blockd.h"
#include "onyx_int.h"
@@ -355,6 +356,8 @@
/* Activity mask based per mb zbin adjustments */
vpx_free(cpi->mb_activity_map);
cpi->mb_activity_map = 0;
+ vpx_free(cpi->mb_norm_activity_map);
+ cpi->mb_norm_activity_map = 0;
vpx_free(cpi->mb.pip);
cpi->mb.pip = 0;
@@ -1095,6 +1098,11 @@
vpx_calloc(sizeof(*cpi->mb_activity_map),
cm->mb_rows * cm->mb_cols));
+ vpx_free(cpi->mb_norm_activity_map);
+ CHECK_MEM_ERROR(cpi->mb_norm_activity_map,
+ vpx_calloc(sizeof(*cpi->mb_norm_activity_map),
+ cm->mb_rows * cm->mb_cols));
+
/* allocate memory for storing last frame's MVs for MV prediction. */
vpx_free(cpi->lfmv);
CHECK_MEM_ERROR(cpi->lfmv, vpx_calloc((cm->mb_rows+2) * (cm->mb_cols+2),
@@ -2857,19 +2865,40 @@
if ((cpi->compressor_speed == 2) && (cpi->Speed >= 5) && (cpi->sf.RD == 0))
{
- double change = 1.0 * abs((int)(cpi->mb.intra_error -
- cpi->last_intra_error)) / (1 + cpi->last_intra_error);
- double change2 = 1.0 * abs((int)(cpi->mb.prediction_error -
- cpi->last_prediction_error)) / (1 + cpi->last_prediction_error);
+ double change = 1.0 * abs((int)(cpi->intra_error - cpi->last_intra_error)) / (1 + cpi->last_intra_error);
+ double change2 = 1.0 * abs((int)(cpi->prediction_error - cpi->last_prediction_error)) / (1 + cpi->last_prediction_error);
double minerror = cm->MBs * 256;
- cpi->last_intra_error = cpi->mb.intra_error;
- cpi->last_prediction_error = cpi->mb.prediction_error;
+#if 0
- if (10 * cpi->mb.intra_error / (1 + cpi->mb.prediction_error) < 15
- && cpi->mb.prediction_error > minerror
+ if (10 * cpi->intra_error / (1 + cpi->prediction_error) < 15
+ && cpi->prediction_error > minerror
&& (change > .25 || change2 > .25))
{
+ FILE *f = fopen("intra_inter.stt", "a");
+
+ if (cpi->prediction_error <= 0)
+ cpi->prediction_error = 1;
+
+ fprintf(f, "%d %d %d %d %14.4f\n",
+ cm->current_video_frame,
+ (int) cpi->prediction_error,
+ (int) cpi->intra_error,
+ (int)((10 * cpi->intra_error) / cpi->prediction_error),
+ change);
+
+ fclose(f);
+ }
+
+#endif
+
+ cpi->last_intra_error = cpi->intra_error;
+ cpi->last_prediction_error = cpi->prediction_error;
+
+ if (10 * cpi->intra_error / (1 + cpi->prediction_error) < 15
+ && cpi->prediction_error > minerror
+ && (change > .25 || change2 > .25))
+ {
/*(change > 1.4 || change < .75)&& cpi->this_frame_percent_intra > cpi->last_frame_percent_intra + 3*/
return 1;
}

Powered by Google App Engine
This is Rietveld 408576698