diff options
Diffstat (limited to 'vp8/encoder')
-rw-r--r-- | vp8/encoder/bitstream.c | 4 | ||||
-rw-r--r-- | vp8/encoder/encodeframe.c | 2 | ||||
-rw-r--r-- | vp8/encoder/onyx_if.c | 58 | ||||
-rw-r--r-- | vp8/encoder/onyx_int.h | 14 | ||||
-rw-r--r-- | vp8/encoder/picklpf.c | 8 | ||||
-rw-r--r-- | vp8/encoder/quantize.c | 12 |
6 files changed, 51 insertions, 47 deletions
diff --git a/vp8/encoder/bitstream.c b/vp8/encoder/bitstream.c index e65a7f9d4..7c4ec9a88 100644 --- a/vp8/encoder/bitstream.c +++ b/vp8/encoder/bitstream.c @@ -1846,8 +1846,8 @@ void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned long *size) vp8_write_bit(bc, (xd->mb_segement_abs_delta) ? 1 : 0); - // For each segmentation feature (Quant and loop filter level) - for (i = 0; i < MB_LVL_MAX; i++) + // For each segmentation codable feature + for (i = 0; i < SEG_LVL_MAX; i++) { // For each of the segments for (j = 0; j < MAX_MB_SEGMENTS; j++) diff --git a/vp8/encoder/encodeframe.c b/vp8/encoder/encodeframe.c index e3c214580..a37727510 100644 --- a/vp8/encoder/encodeframe.c +++ b/vp8/encoder/encodeframe.c @@ -995,7 +995,7 @@ void vp8_encode_frame(VP8_COMP *cpi) vp8cx_frame_init_quantizer(cpi); - vp8_initialize_rd_consts(cpi, cm->base_qindex + cm->y1dc_delta_q);
+ vp8_initialize_rd_consts(cpi, cm->base_qindex + cm->y1dc_delta_q); vp8cx_initialize_me_consts(cpi, cm->base_qindex); if(cpi->oxcf.tuning == VP8_TUNE_SSIM) diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c index e2fd622f3..866f542b8 100644 --- a/vp8/encoder/onyx_if.c +++ b/vp8/encoder/onyx_if.c @@ -428,8 +428,8 @@ static void set_segmentation_map(VP8_PTR ptr, unsigned char *segmentation_map) // The values given for each segment can be either deltas (from the default value chosen for the frame) or absolute values. // -// Valid range for abs values is (0-127 for MB_LVL_ALT_Q) , (0-63 for SEGMENT_ALT_LF) -// Valid range for delta values are (+/-127 for MB_LVL_ALT_Q) , (+/-63 for SEGMENT_ALT_LF) +// Valid range for abs values is (0-127 for SEG_LVL_ALT_Q) , (0-63 for SEGMENT_ALT_LF) +// Valid range for delta values are (+/-127 for SEG_LVL_ALT_Q) , (+/-63 for SEGMENT_ALT_LF) // // abs_delta = SEGMENT_DELTADATA (deltas) abs_delta = SEGMENT_ABSDATA (use the absolute values given). // @@ -447,7 +447,7 @@ static void segmentation_test_function(VP8_PTR ptr) { VP8_COMP *cpi = (VP8_COMP *)(ptr); unsigned char *seg_map; - signed char feature_data[MB_LVL_MAX][MAX_MB_SEGMENTS]; + signed char feature_data[SEG_LVL_MAX][MAX_MB_SEGMENTS]; CHECK_MEM_ERROR(seg_map, vpx_calloc((cpi->common.mb_rows * cpi->common.mb_cols), 1)); // Create a temporary map for segmentation data. @@ -478,15 +478,15 @@ static void segmentation_test_function(VP8_PTR ptr) enable_segmentation(ptr); // Set up the quant segment data - feature_data[MB_LVL_ALT_Q][0] = 0; - feature_data[MB_LVL_ALT_Q][1] = 4; - feature_data[MB_LVL_ALT_Q][2] = 0; - feature_data[MB_LVL_ALT_Q][3] = 0; + feature_data[SEG_LVL_ALT_Q][0] = 0; + feature_data[SEG_LVL_ALT_Q][1] = 4; + feature_data[SEG_LVL_ALT_Q][2] = 0; + feature_data[SEG_LVL_ALT_Q][3] = 0; // Set up the loop segment data - feature_data[MB_LVL_ALT_LF][0] = 0; - feature_data[MB_LVL_ALT_LF][1] = 0; - feature_data[MB_LVL_ALT_LF][2] = 0; - feature_data[MB_LVL_ALT_LF][3] = 0; + feature_data[SEG_LVL_ALT_LF][0] = 0; + feature_data[SEG_LVL_ALT_LF][1] = 0; + feature_data[SEG_LVL_ALT_LF][2] = 0; + feature_data[SEG_LVL_ALT_LF][3] = 0; // Initialise the feature data structure // SEGMENT_DELTADATA 0, SEGMENT_ABSDATA 1 @@ -503,7 +503,7 @@ static void segmentation_test_function(VP8_PTR ptr) static void cyclic_background_refresh(VP8_COMP *cpi, int Q, int lf_adjustment) { unsigned char *seg_map; - signed char feature_data[MB_LVL_MAX][MAX_MB_SEGMENTS]; + signed char feature_data[SEG_LVL_MAX][MAX_MB_SEGMENTS]; int i; int block_count = cpi->cyclic_refresh_mode_max_mbs_perframe; int mbs_in_frame = cpi->common.mb_rows * cpi->common.mb_cols; @@ -570,16 +570,16 @@ static void cyclic_background_refresh(VP8_COMP *cpi, int Q, int lf_adjustment) enable_segmentation((VP8_PTR)cpi); // Set up the quant segment data - feature_data[MB_LVL_ALT_Q][0] = 0; - feature_data[MB_LVL_ALT_Q][1] = (cpi->cyclic_refresh_q - Q); - feature_data[MB_LVL_ALT_Q][2] = 0; - feature_data[MB_LVL_ALT_Q][3] = 0; + feature_data[SEG_LVL_ALT_Q][0] = 0; + feature_data[SEG_LVL_ALT_Q][1] = (cpi->cyclic_refresh_q - Q); + feature_data[SEG_LVL_ALT_Q][2] = 0; + feature_data[SEG_LVL_ALT_Q][3] = 0; // Set up the loop segment data - feature_data[MB_LVL_ALT_LF][0] = 0; - feature_data[MB_LVL_ALT_LF][1] = lf_adjustment; - feature_data[MB_LVL_ALT_LF][2] = 0; - feature_data[MB_LVL_ALT_LF][3] = 0; + feature_data[SEG_LVL_ALT_LF][0] = 0; + feature_data[SEG_LVL_ALT_LF][1] = lf_adjustment; + feature_data[SEG_LVL_ALT_LF][2] = 0; + feature_data[SEG_LVL_ALT_LF][3] = 0; // Initialise the feature data structure // SEGMENT_DELTADATA 0, SEGMENT_ABSDATA 1 @@ -5202,7 +5202,7 @@ int vp8_get_preview_raw_frame(VP8_PTR comp, YV12_BUFFER_CONFIG *dest, vp8_ppflag int vp8_set_roimap(VP8_PTR comp, unsigned char *map, unsigned int rows, unsigned int cols, int delta_q[4], int delta_lf[4], unsigned int threshold[4]) { VP8_COMP *cpi = (VP8_COMP *) comp; - signed char feature_data[MB_LVL_MAX][MAX_MB_SEGMENTS]; + signed char feature_data[SEG_LVL_MAX][MAX_MB_SEGMENTS]; if (cpi->common.mb_rows != rows || cpi->common.mb_cols != cols) return -1; @@ -5220,16 +5220,16 @@ int vp8_set_roimap(VP8_PTR comp, unsigned char *map, unsigned int rows, unsigned enable_segmentation((VP8_PTR)cpi); // Set up the quant segment data - feature_data[MB_LVL_ALT_Q][0] = delta_q[0]; - feature_data[MB_LVL_ALT_Q][1] = delta_q[1]; - feature_data[MB_LVL_ALT_Q][2] = delta_q[2]; - feature_data[MB_LVL_ALT_Q][3] = delta_q[3]; + feature_data[SEG_LVL_ALT_Q][0] = delta_q[0]; + feature_data[SEG_LVL_ALT_Q][1] = delta_q[1]; + feature_data[SEG_LVL_ALT_Q][2] = delta_q[2]; + feature_data[SEG_LVL_ALT_Q][3] = delta_q[3]; // Set up the loop segment data s - feature_data[MB_LVL_ALT_LF][0] = delta_lf[0]; - feature_data[MB_LVL_ALT_LF][1] = delta_lf[1]; - feature_data[MB_LVL_ALT_LF][2] = delta_lf[2]; - feature_data[MB_LVL_ALT_LF][3] = delta_lf[3]; + feature_data[SEG_LVL_ALT_LF][0] = delta_lf[0]; + feature_data[SEG_LVL_ALT_LF][1] = delta_lf[1]; + feature_data[SEG_LVL_ALT_LF][2] = delta_lf[2]; + feature_data[SEG_LVL_ALT_LF][3] = delta_lf[3]; cpi->segment_encode_breakout[0] = threshold[0]; cpi->segment_encode_breakout[1] = threshold[1]; diff --git a/vp8/encoder/onyx_int.h b/vp8/encoder/onyx_int.h index 8519b8f81..403508bb0 100644 --- a/vp8/encoder/onyx_int.h +++ b/vp8/encoder/onyx_int.h @@ -470,14 +470,18 @@ typedef struct VP8_COMP int gf_update_recommended; int skip_true_count; int skip_false_count; -#if CONFIG_T8X8
- int t4x4_count;
- int t8x8_count;
+#if CONFIG_T8X8 + int t4x4_count; + int t8x8_count; #endif unsigned char *segmentation_map; - signed char segment_feature_data[MB_LVL_MAX][MAX_MB_SEGMENTS]; // Segment data (can be deltas or absolute values) - int segment_encode_breakout[MAX_MB_SEGMENTS]; // segment threashold for encode breakout + + // Segment data (can be deltas or absolute values) + signed char segment_feature_data[SEG_LVL_MAX][MAX_MB_SEGMENTS]; + + // segment threashold for encode breakout + int segment_encode_breakout[MAX_MB_SEGMENTS]; unsigned char *active_map; unsigned int active_map_enabled; diff --git a/vp8/encoder/picklpf.c b/vp8/encoder/picklpf.c index beefe8d8e..3a6117f6f 100644 --- a/vp8/encoder/picklpf.c +++ b/vp8/encoder/picklpf.c @@ -259,10 +259,10 @@ void vp8cx_set_alt_lf_level(VP8_COMP *cpi, int filt_val) MACROBLOCKD *mbd = &cpi->mb.e_mbd; (void) filt_val; - mbd->segment_feature_data[MB_LVL_ALT_LF][0] = cpi->segment_feature_data[MB_LVL_ALT_LF][0]; - mbd->segment_feature_data[MB_LVL_ALT_LF][1] = cpi->segment_feature_data[MB_LVL_ALT_LF][1]; - mbd->segment_feature_data[MB_LVL_ALT_LF][2] = cpi->segment_feature_data[MB_LVL_ALT_LF][2]; - mbd->segment_feature_data[MB_LVL_ALT_LF][3] = cpi->segment_feature_data[MB_LVL_ALT_LF][3]; + mbd->segment_feature_data[SEG_LVL_ALT_LF][0] = cpi->segment_feature_data[SEG_LVL_ALT_LF][0]; + mbd->segment_feature_data[SEG_LVL_ALT_LF][1] = cpi->segment_feature_data[SEG_LVL_ALT_LF][1]; + mbd->segment_feature_data[SEG_LVL_ALT_LF][2] = cpi->segment_feature_data[SEG_LVL_ALT_LF][2]; + mbd->segment_feature_data[SEG_LVL_ALT_LF][3] = cpi->segment_feature_data[SEG_LVL_ALT_LF][3]; } void vp8cx_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP8_COMP *cpi) diff --git a/vp8/encoder/quantize.c b/vp8/encoder/quantize.c index 328eabbf9..200d1ae0a 100644 --- a/vp8/encoder/quantize.c +++ b/vp8/encoder/quantize.c @@ -1174,11 +1174,11 @@ void vp8cx_mb_init_quantizer(VP8_COMP *cpi, MACROBLOCK *x) // Abs Value if (xd->mb_segement_abs_delta == SEGMENT_ABSDATA) - QIndex = xd->segment_feature_data[MB_LVL_ALT_Q][xd->mode_info_context->mbmi.segment_id]; + QIndex = xd->segment_feature_data[SEG_LVL_ALT_Q][xd->mode_info_context->mbmi.segment_id]; // Delta Value else { - QIndex = cpi->common.base_qindex + xd->segment_feature_data[MB_LVL_ALT_Q][xd->mode_info_context->mbmi.segment_id]; + QIndex = cpi->common.base_qindex + xd->segment_feature_data[SEG_LVL_ALT_Q][xd->mode_info_context->mbmi.segment_id]; QIndex = (QIndex >= 0) ? ((QIndex <= MAXQ) ? QIndex : MAXQ) : 0; // Clamp to valid range } } @@ -1316,10 +1316,10 @@ void vp8_set_quantizer(struct VP8_COMP *cpi, int Q) // Set Segment specific quatizers - mbd->segment_feature_data[MB_LVL_ALT_Q][0] = cpi->segment_feature_data[MB_LVL_ALT_Q][0]; - mbd->segment_feature_data[MB_LVL_ALT_Q][1] = cpi->segment_feature_data[MB_LVL_ALT_Q][1]; - mbd->segment_feature_data[MB_LVL_ALT_Q][2] = cpi->segment_feature_data[MB_LVL_ALT_Q][2]; - mbd->segment_feature_data[MB_LVL_ALT_Q][3] = cpi->segment_feature_data[MB_LVL_ALT_Q][3]; + mbd->segment_feature_data[SEG_LVL_ALT_Q][0] = cpi->segment_feature_data[SEG_LVL_ALT_Q][0]; + mbd->segment_feature_data[SEG_LVL_ALT_Q][1] = cpi->segment_feature_data[SEG_LVL_ALT_Q][1]; + mbd->segment_feature_data[SEG_LVL_ALT_Q][2] = cpi->segment_feature_data[SEG_LVL_ALT_Q][2]; + mbd->segment_feature_data[SEG_LVL_ALT_Q][3] = cpi->segment_feature_data[SEG_LVL_ALT_Q][3]; /* quantizer has to be reinitialized for any delta_q changes */ if(update) |