Merge "Cleanup typos, remove unnecessary lines, replace switch"
This commit is contained in:
@@ -493,16 +493,16 @@ static INLINE void foreach_transformed_block_in_plane(
|
|||||||
// it to 4x4 block sizes.
|
// it to 4x4 block sizes.
|
||||||
if (xd->mb_to_right_edge < 0)
|
if (xd->mb_to_right_edge < 0)
|
||||||
max_blocks_wide +=
|
max_blocks_wide +=
|
||||||
+ (xd->mb_to_right_edge >> (5 + xd->plane[plane].subsampling_x));
|
(xd->mb_to_right_edge >> (5 + xd->plane[plane].subsampling_x));
|
||||||
|
|
||||||
if (xd->mb_to_bottom_edge < 0)
|
if (xd->mb_to_bottom_edge < 0)
|
||||||
max_blocks_high +=
|
max_blocks_high +=
|
||||||
+ (xd->mb_to_bottom_edge >> (5 + xd->plane[plane].subsampling_y));
|
(xd->mb_to_bottom_edge >> (5 + xd->plane[plane].subsampling_y));
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
// Unlike the normal case - in here we have to keep track of the
|
// Unlike the normal case - in here we have to keep track of the
|
||||||
// row and column of the blocks we use so that we know if we are in
|
// row and column of the blocks we use so that we know if we are in
|
||||||
// the unrestricted motion border..
|
// the unrestricted motion border.
|
||||||
for (r = 0; r < (1 << sh); r += (1 << tx_size)) {
|
for (r = 0; r < (1 << sh); r += (1 << tx_size)) {
|
||||||
for (c = 0; c < (1 << sw); c += (1 << tx_size)) {
|
for (c = 0; c < (1 << sw); c += (1 << tx_size)) {
|
||||||
if (r < max_blocks_high && c < max_blocks_wide)
|
if (r < max_blocks_high && c < max_blocks_wide)
|
||||||
|
|||||||
@@ -2119,7 +2119,7 @@ static void encode_frame_internal(VP9_COMP *cpi) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
vpx_usec_timer_mark(&emr_timer);
|
vpx_usec_timer_mark(&emr_timer);
|
||||||
cpi->time_encode_mb_row += vpx_usec_timer_elapsed(&emr_timer);
|
cpi->time_encode_sb_row += vpx_usec_timer_elapsed(&emr_timer);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cpi->sf.skip_encode_sb) {
|
if (cpi->sf.skip_encode_sb) {
|
||||||
|
|||||||
@@ -1839,7 +1839,10 @@ void vp9_remove_compressor(VP9_PTR *ptr) {
|
|||||||
{
|
{
|
||||||
printf("\n_pick_loop_filter_level:%d\n", cpi->time_pick_lpf / 1000);
|
printf("\n_pick_loop_filter_level:%d\n", cpi->time_pick_lpf / 1000);
|
||||||
printf("\n_frames recive_data encod_mb_row compress_frame Total\n");
|
printf("\n_frames recive_data encod_mb_row compress_frame Total\n");
|
||||||
printf("%6d %10ld %10ld %10ld %10ld\n", cpi->common.current_video_frame, cpi->time_receive_data / 1000, cpi->time_encode_mb_row / 1000, cpi->time_compress_data / 1000, (cpi->time_receive_data + cpi->time_compress_data) / 1000);
|
printf("%6d %10ld %10ld %10ld %10ld\n", cpi->common.current_video_frame,
|
||||||
|
cpi->time_receive_data / 1000, cpi->time_encode_sb_row / 1000,
|
||||||
|
cpi->time_compress_data / 1000,
|
||||||
|
(cpi->time_receive_data + cpi->time_compress_data) / 1000);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -530,7 +530,7 @@ typedef struct VP9_COMP {
|
|||||||
uint64_t time_receive_data;
|
uint64_t time_receive_data;
|
||||||
uint64_t time_compress_data;
|
uint64_t time_compress_data;
|
||||||
uint64_t time_pick_lpf;
|
uint64_t time_pick_lpf;
|
||||||
uint64_t time_encode_mb_row;
|
uint64_t time_encode_sb_row;
|
||||||
|
|
||||||
struct twopass_rc {
|
struct twopass_rc {
|
||||||
unsigned int section_intra_rating;
|
unsigned int section_intra_rating;
|
||||||
|
|||||||
@@ -1329,6 +1329,7 @@ static int64_t rd_pick_intra4x4mby_modes(VP9_COMP *cpi, MACROBLOCK *mb,
|
|||||||
|
|
||||||
bmode_costs = mb->mbmode_cost;
|
bmode_costs = mb->mbmode_cost;
|
||||||
|
|
||||||
|
// Pick modes for each sub-block (of size 4x4, 4x8, or 8x4) in an 8x8 block.
|
||||||
for (idy = 0; idy < 2; idy += num_4x4_blocks_high) {
|
for (idy = 0; idy < 2; idy += num_4x4_blocks_high) {
|
||||||
for (idx = 0; idx < 2; idx += num_4x4_blocks_wide) {
|
for (idx = 0; idx < 2; idx += num_4x4_blocks_wide) {
|
||||||
const int mis = xd->mode_info_stride;
|
const int mis = xd->mode_info_stride;
|
||||||
@@ -1396,7 +1397,7 @@ static int64_t rd_pick_intra_sby_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
|||||||
txfm_cache[i] = INT64_MAX;
|
txfm_cache[i] = INT64_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Y Search for 32x32 intra prediction mode */
|
/* Y Search for intra prediction mode */
|
||||||
for (mode = DC_PRED; mode <= TM_PRED; mode++) {
|
for (mode = DC_PRED; mode <= TM_PRED; mode++) {
|
||||||
int64_t local_txfm_cache[TX_MODES];
|
int64_t local_txfm_cache[TX_MODES];
|
||||||
MODE_INFO *const mic = xd->mode_info_context;
|
MODE_INFO *const mic = xd->mode_info_context;
|
||||||
@@ -1528,8 +1529,6 @@ static int64_t rd_sbuv_dcpred(VP9_COMP *cpi, MACROBLOCK *x,
|
|||||||
x->intra_uv_mode_cost[cpi->common.frame_type][DC_PRED];
|
x->intra_uv_mode_cost[cpi->common.frame_type][DC_PRED];
|
||||||
this_rd = RDCOST(x->rdmult, x->rddiv, *rate, *distortion);
|
this_rd = RDCOST(x->rdmult, x->rddiv, *rate, *distortion);
|
||||||
|
|
||||||
x->e_mbd.mode_info_context->mbmi.uv_mode = DC_PRED;
|
|
||||||
|
|
||||||
return this_rd;
|
return this_rd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2766,9 +2765,8 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
|||||||
int orig_dst_stride[MAX_MB_PLANE];
|
int orig_dst_stride[MAX_MB_PLANE];
|
||||||
int rs = 0;
|
int rs = 0;
|
||||||
|
|
||||||
switch (this_mode) {
|
if (this_mode == NEWMV) {
|
||||||
int rate_mv;
|
int rate_mv;
|
||||||
case NEWMV:
|
|
||||||
if (is_comp_pred) {
|
if (is_comp_pred) {
|
||||||
// Initialize mv using single prediction mode result.
|
// Initialize mv using single prediction mode result.
|
||||||
frame_mv[refs[0]].as_int = single_newmv[refs[0]].as_int;
|
frame_mv[refs[0]].as_int = single_newmv[refs[0]].as_int;
|
||||||
@@ -2793,19 +2791,12 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
|||||||
*rate2 += rate_mv;
|
*rate2 += rate_mv;
|
||||||
} else {
|
} else {
|
||||||
int_mv tmp_mv;
|
int_mv tmp_mv;
|
||||||
single_motion_search(cpi, x, bsize, mi_row, mi_col,
|
single_motion_search(cpi, x, bsize, mi_row, mi_col, &tmp_mv, &rate_mv);
|
||||||
&tmp_mv, &rate_mv);
|
|
||||||
*rate2 += rate_mv;
|
*rate2 += rate_mv;
|
||||||
frame_mv[refs[0]].as_int =
|
frame_mv[refs[0]].as_int =
|
||||||
xd->mode_info_context->bmi[0].as_mv[0].as_int = tmp_mv.as_int;
|
xd->mode_info_context->bmi[0].as_mv[0].as_int = tmp_mv.as_int;
|
||||||
single_newmv[refs[0]].as_int = tmp_mv.as_int;
|
single_newmv[refs[0]].as_int = tmp_mv.as_int;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
case NEARMV:
|
|
||||||
case NEARESTMV:
|
|
||||||
case ZEROMV:
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we're near/nearest and mv == 0,0, compare to zeromv
|
// if we're near/nearest and mv == 0,0, compare to zeromv
|
||||||
@@ -2986,7 +2977,7 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
|||||||
xd->plane[i].dst.stride = orig_dst_stride[i];
|
xd->plane[i].dst.stride = orig_dst_stride[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Set the appripriate filter
|
// Set the appropriate filter
|
||||||
mbmi->interp_filter = cm->mcomp_filter_type != SWITCHABLE ?
|
mbmi->interp_filter = cm->mcomp_filter_type != SWITCHABLE ?
|
||||||
cm->mcomp_filter_type : *best_filter;
|
cm->mcomp_filter_type : *best_filter;
|
||||||
vp9_setup_interp_filters(xd, mbmi->interp_filter, cm);
|
vp9_setup_interp_filters(xd, mbmi->interp_filter, cm);
|
||||||
@@ -3272,7 +3263,6 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
|
|||||||
ctx->frames_with_high_error = 0;
|
ctx->frames_with_high_error = 0;
|
||||||
ctx->modes_with_high_error = 0;
|
ctx->modes_with_high_error = 0;
|
||||||
|
|
||||||
xd->mode_info_context->mbmi.segment_id = segment_id;
|
|
||||||
estimate_ref_frame_costs(cpi, segment_id, ref_costs_single, ref_costs_comp,
|
estimate_ref_frame_costs(cpi, segment_id, ref_costs_single, ref_costs_comp,
|
||||||
&comp_mode_p);
|
&comp_mode_p);
|
||||||
vpx_memset(&best_mbmode, 0, sizeof(best_mbmode));
|
vpx_memset(&best_mbmode, 0, sizeof(best_mbmode));
|
||||||
@@ -3289,7 +3279,8 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
|
|||||||
|
|
||||||
*returnrate = INT_MAX;
|
*returnrate = INT_MAX;
|
||||||
|
|
||||||
// Create a mask set to 1 for each frame used by a smaller resolution.
|
// Create a mask set to 1 for each reference frame used by a smaller
|
||||||
|
// resolution.
|
||||||
if (cpi->sf.use_avoid_tested_higherror) {
|
if (cpi->sf.use_avoid_tested_higherror) {
|
||||||
switch (block_size) {
|
switch (block_size) {
|
||||||
case BLOCK_64X64:
|
case BLOCK_64X64:
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ int vp8_yv12_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf,
|
|||||||
|
|
||||||
/* Only support allocating buffers that have a border that's a multiple
|
/* Only support allocating buffers that have a border that's a multiple
|
||||||
* of 32. The border restriction is required to get 16-byte alignment of
|
* of 32. The border restriction is required to get 16-byte alignment of
|
||||||
* the start of the chroma rows without intoducing an arbitrary gap
|
* the start of the chroma rows without introducing an arbitrary gap
|
||||||
* between planes, which would break the semantics of things like
|
* between planes, which would break the semantics of things like
|
||||||
* vpx_img_set_rect(). */
|
* vpx_img_set_rect(). */
|
||||||
if (border & 0x1f)
|
if (border & 0x1f)
|
||||||
@@ -158,7 +158,7 @@ int vp9_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf,
|
|||||||
|
|
||||||
/* Only support allocating buffers that have a border that's a multiple
|
/* Only support allocating buffers that have a border that's a multiple
|
||||||
* of 32. The border restriction is required to get 16-byte alignment of
|
* of 32. The border restriction is required to get 16-byte alignment of
|
||||||
* the start of the chroma rows without intoducing an arbitrary gap
|
* the start of the chroma rows without introducing an arbitrary gap
|
||||||
* between planes, which would break the semantics of things like
|
* between planes, which would break the semantics of things like
|
||||||
* vpx_img_set_rect(). */
|
* vpx_img_set_rect(). */
|
||||||
if (border & 0x1f)
|
if (border & 0x1f)
|
||||||
|
|||||||
Reference in New Issue
Block a user