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

Side by Side Diff: source/libvpx/vp8/encoder/firstpass.c

Issue 812033011: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 5 years, 11 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « source/libvpx/vp8/encoder/encodeframe.c ('k') | source/libvpx/vp8/encoder/mcomp.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 cpi->twopass.stats_in = 125 cpi->twopass.stats_in =
126 (void*)((char *)cpi->twopass.stats_in + sizeof(FIRSTPASS_STATS)); 126 (void*)((char *)cpi->twopass.stats_in + sizeof(FIRSTPASS_STATS));
127 return 1; 127 return 1;
128 } 128 }
129 129
130 static void output_stats(const VP8_COMP *cpi, 130 static void output_stats(const VP8_COMP *cpi,
131 struct vpx_codec_pkt_list *pktlist, 131 struct vpx_codec_pkt_list *pktlist,
132 FIRSTPASS_STATS *stats) 132 FIRSTPASS_STATS *stats)
133 { 133 {
134 struct vpx_codec_cx_pkt pkt; 134 struct vpx_codec_cx_pkt pkt;
135 (void)cpi;
135 pkt.kind = VPX_CODEC_STATS_PKT; 136 pkt.kind = VPX_CODEC_STATS_PKT;
136 pkt.data.twopass_stats.buf = stats; 137 pkt.data.twopass_stats.buf = stats;
137 pkt.data.twopass_stats.sz = sizeof(FIRSTPASS_STATS); 138 pkt.data.twopass_stats.sz = sizeof(FIRSTPASS_STATS);
138 vpx_codec_pkt_list_add(pktlist, &pkt); 139 vpx_codec_pkt_list_add(pktlist, &pkt);
139 140
140 /* TEMP debug code */ 141 /* TEMP debug code */
141 #if OUTPUT_FPF 142 #if OUTPUT_FPF
142 143
143 { 144 {
144 FILE *fpfile; 145 FILE *fpfile;
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 MACROBLOCKD * const xd = & x->e_mbd; 412 MACROBLOCKD * const xd = & x->e_mbd;
412 BLOCK *b = &x->block[0]; 413 BLOCK *b = &x->block[0];
413 BLOCKD *d = &x->e_mbd.block[0]; 414 BLOCKD *d = &x->e_mbd.block[0];
414 415
415 unsigned char *src_ptr = (*(b->base_src) + b->src); 416 unsigned char *src_ptr = (*(b->base_src) + b->src);
416 int src_stride = b->src_stride; 417 int src_stride = b->src_stride;
417 unsigned char *raw_ptr; 418 unsigned char *raw_ptr;
418 int raw_stride = raw_buffer->y_stride; 419 int raw_stride = raw_buffer->y_stride;
419 unsigned char *ref_ptr; 420 unsigned char *ref_ptr;
420 int ref_stride = x->e_mbd.pre.y_stride; 421 int ref_stride = x->e_mbd.pre.y_stride;
422 (void)cpi;
421 423
422 /* Set up pointers for this macro block raw buffer */ 424 /* Set up pointers for this macro block raw buffer */
423 raw_ptr = (unsigned char *)(raw_buffer->y_buffer + recon_yoffset 425 raw_ptr = (unsigned char *)(raw_buffer->y_buffer + recon_yoffset
424 + d->offset); 426 + d->offset);
425 vp8_mse16x16 ( src_ptr, src_stride, raw_ptr, raw_stride, 427 vp8_mse16x16 ( src_ptr, src_stride, raw_ptr, raw_stride,
426 (unsigned int *)(raw_motion_err)); 428 (unsigned int *)(raw_motion_err));
427 429
428 /* Set up pointers for this macro block recon buffer */ 430 /* Set up pointers for this macro block recon buffer */
429 xd->pre.y_buffer = recon_buffer->y_buffer + recon_yoffset; 431 xd->pre.y_buffer = recon_buffer->y_buffer + recon_yoffset;
430 ref_ptr = (unsigned char *)(xd->pre.y_buffer + d->offset ); 432 ref_ptr = (unsigned char *)(xd->pre.y_buffer + d->offset );
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after
1402 } 1404 }
1403 cpi->twopass.modified_error_left = cpi->twopass.modified_error_total; 1405 cpi->twopass.modified_error_left = cpi->twopass.modified_error_total;
1404 1406
1405 reset_fpf_position(cpi, start_pos); /* Reset file position */ 1407 reset_fpf_position(cpi, start_pos); /* Reset file position */
1406 1408
1407 } 1409 }
1408 } 1410 }
1409 1411
1410 void vp8_end_second_pass(VP8_COMP *cpi) 1412 void vp8_end_second_pass(VP8_COMP *cpi)
1411 { 1413 {
1414 (void)cpi;
1412 } 1415 }
1413 1416
1414 /* This function gives and estimate of how badly we believe the prediction 1417 /* This function gives and estimate of how badly we believe the prediction
1415 * quality is decaying from frame to frame. 1418 * quality is decaying from frame to frame.
1416 */ 1419 */
1417 static double get_prediction_decay_rate(VP8_COMP *cpi, FIRSTPASS_STATS *next_fra me) 1420 static double get_prediction_decay_rate(VP8_COMP *cpi, FIRSTPASS_STATS *next_fra me)
1418 { 1421 {
1419 double prediction_decay_rate; 1422 double prediction_decay_rate;
1420 double motion_decay; 1423 double motion_decay;
1421 double motion_pct = next_frame->pcnt_motion; 1424 double motion_pct = next_frame->pcnt_motion;
1425 (void)cpi;
1422 1426
1423 /* Initial basis is the % mbs inter coded */ 1427 /* Initial basis is the % mbs inter coded */
1424 prediction_decay_rate = next_frame->pcnt_inter; 1428 prediction_decay_rate = next_frame->pcnt_inter;
1425 1429
1426 /* High % motion -> somewhat higher decay rate */ 1430 /* High % motion -> somewhat higher decay rate */
1427 motion_decay = (1.0 - (motion_pct / 20.0)); 1431 motion_decay = (1.0 - (motion_pct / 20.0));
1428 if (motion_decay < prediction_decay_rate) 1432 if (motion_decay < prediction_decay_rate)
1429 prediction_decay_rate = motion_decay; 1433 prediction_decay_rate = motion_decay;
1430 1434
1431 /* Adjustment to decay rate based on speed of motion */ 1435 /* Adjustment to decay rate based on speed of motion */
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
1540 VP8_COMP *cpi, 1544 VP8_COMP *cpi,
1541 FIRSTPASS_STATS * this_frame, 1545 FIRSTPASS_STATS * this_frame,
1542 double * this_frame_mv_in_out, 1546 double * this_frame_mv_in_out,
1543 double * mv_in_out_accumulator, 1547 double * mv_in_out_accumulator,
1544 double * abs_mv_in_out_accumulator, 1548 double * abs_mv_in_out_accumulator,
1545 double * mv_ratio_accumulator ) 1549 double * mv_ratio_accumulator )
1546 { 1550 {
1547 double this_frame_mvr_ratio; 1551 double this_frame_mvr_ratio;
1548 double this_frame_mvc_ratio; 1552 double this_frame_mvc_ratio;
1549 double motion_pct; 1553 double motion_pct;
1554 (void)cpi;
1550 1555
1551 /* Accumulate motion stats. */ 1556 /* Accumulate motion stats. */
1552 motion_pct = this_frame->pcnt_motion; 1557 motion_pct = this_frame->pcnt_motion;
1553 1558
1554 /* Accumulate Motion In/Out of frame stats */ 1559 /* Accumulate Motion In/Out of frame stats */
1555 *this_frame_mv_in_out = this_frame->mv_in_out_count * motion_pct; 1560 *this_frame_mv_in_out = this_frame->mv_in_out_count * motion_pct;
1556 *mv_in_out_accumulator += this_frame->mv_in_out_count * motion_pct; 1561 *mv_in_out_accumulator += this_frame->mv_in_out_count * motion_pct;
1557 *abs_mv_in_out_accumulator += 1562 *abs_mv_in_out_accumulator +=
1558 fabs(this_frame->mv_in_out_count * motion_pct); 1563 fabs(this_frame->mv_in_out_count * motion_pct);
1559 1564
(...skipping 1798 matching lines...) Expand 10 before | Expand all | Expand 10 after
3358 } 3363 }
3359 3364
3360 if ((cpi->common.Width != new_width) || (cpi->common.Height != new_heigh t)) 3365 if ((cpi->common.Width != new_width) || (cpi->common.Height != new_heigh t))
3361 { 3366 {
3362 cpi->common.Width = new_width; 3367 cpi->common.Width = new_width;
3363 cpi->common.Height = new_height; 3368 cpi->common.Height = new_height;
3364 vp8_alloc_compressor_data(cpi); 3369 vp8_alloc_compressor_data(cpi);
3365 } 3370 }
3366 } 3371 }
3367 } 3372 }
OLDNEW
« no previous file with comments | « source/libvpx/vp8/encoder/encodeframe.c ('k') | source/libvpx/vp8/encoder/mcomp.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698