Commit 87254e0b authored by John Koleszar's avatar John Koleszar

Move quantizer init functions to quantize.c

Group related functions together.

Change-Id: I92fd779225b75a7204650f1decb713142c655d71
parent 00a1e2f8
This diff is collapsed.
......@@ -2653,45 +2653,6 @@ static void resize_key_frame(VP8_COMP *cpi)
}
static void set_quantizer(VP8_COMP *cpi, int Q)
{
VP8_COMMON *cm = &cpi->common;
MACROBLOCKD *mbd = &cpi->mb.e_mbd;
int update = 0;
int new_delta_q;
cm->base_qindex = Q;
/* if any of the delta_q values are changing update flag has to be set */
/* currently only y2dc_delta_q may change */
cm->y1dc_delta_q = 0;
cm->y2ac_delta_q = 0;
cm->uvdc_delta_q = 0;
cm->uvac_delta_q = 0;
if (Q < 4)
{
new_delta_q = 4-Q;
}
else
new_delta_q = 0;
update |= cm->y2dc_delta_q != new_delta_q;
cm->y2dc_delta_q = new_delta_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];
/* quantizer has to be reinitialized for any delta_q changes */
if(update)
vp8cx_init_quantizer(cpi);
}
static void update_alt_ref_frame_and_stats(VP8_COMP *cpi)
{
VP8_COMMON *cm = &cpi->common;
......@@ -3034,7 +2995,7 @@ static void Pass1Encode(VP8_COMP *cpi, unsigned long *size, unsigned char *dest,
(void) size;
(void) dest;
(void) frame_flags;
set_quantizer(cpi, 26);
vp8_set_quantizer(cpi, 26);
scale_and_extend_source(cpi->un_scaled_source, cpi);
vp8_first_pass(cpi);
......@@ -3694,7 +3655,7 @@ static void encode_frame_to_data_rate
Q = 127;
*/
set_quantizer(cpi, Q);
vp8_set_quantizer(cpi, Q);
this_q = Q;
// setup skip prob for costing in mode/mv decision
......
......@@ -240,7 +240,7 @@ enum
BLOCK_MAX_SEGMENTS
};
typedef struct
typedef struct VP8_COMP
{
DECLARE_ALIGNED(16, short, Y1quant[QINDEX_RANGE][16]);
......
This diff is collapsed.
......@@ -55,4 +55,11 @@ extern void vp8_quantize_mb(MACROBLOCK *x);
extern void vp8_quantize_mbuv(MACROBLOCK *x);
extern void vp8_quantize_mby(MACROBLOCK *x);
struct VP8_COMP;
extern void vp8_set_quantizer(struct VP8_COMP *cpi, int Q);
extern void vp8cx_frame_init_quantizer(struct VP8_COMP *cpi);
extern void vp8_update_zbin_extra(struct VP8_COMP *cpi, MACROBLOCK *x);
extern void vp8cx_mb_init_quantizer(struct VP8_COMP *cpi, MACROBLOCK *x);
extern void vp8cx_init_quantizer(struct VP8_COMP *cpi);
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment