Commit 7a197b2d authored by Alex Converse's avatar Alex Converse Committed by Gerrit Code Review

Merge "Have check_initial_width() take subsampling as arguments directly."

parents 000efb57 0428579b
......@@ -3279,12 +3279,12 @@ static void Pass2Encode(VP9_COMP *cpi, size_t *size,
vp9_twopass_postencode_update(cpi, *size);
}
static void check_initial_width(VP9_COMP *cpi, YV12_BUFFER_CONFIG *sd) {
static void check_initial_width(VP9_COMP *cpi, int subsampling_x,
int subsampling_y) {
VP9_COMMON *const cm = &cpi->common;
if (!cpi->initial_width) {
// TODO(agrange) Subsampling defaults to assuming sampled chroma.
cm->subsampling_x = sd != NULL ? (sd->uv_width < sd->y_width) : 1;
cm->subsampling_y = sd != NULL ? (sd->uv_height < sd->y_height) : 1;
cm->subsampling_x = subsampling_x;
cm->subsampling_y = subsampling_y;
alloc_raw_frame_buffers(cpi);
cpi->initial_width = cm->width;
cpi->initial_height = cm->height;
......@@ -3298,8 +3298,10 @@ int vp9_receive_raw_frame(VP9_PTR ptr, unsigned int frame_flags,
VP9_COMP *cpi = (VP9_COMP *) ptr;
struct vpx_usec_timer timer;
int res = 0;
const int subsampling_x = sd->uv_width < sd->y_width;
const int subsampling_y = sd->uv_height < sd->y_height;
check_initial_width(cpi, sd);
check_initial_width(cpi, subsampling_x, subsampling_y);
vpx_usec_timer_start(&timer);
if (vp9_lookahead_push(cpi->lookahead, sd, time_stamp, end_time, frame_flags,
cpi->active_map_enabled ? cpi->active_map : NULL))
......@@ -3798,7 +3800,7 @@ int vp9_set_size_literal(VP9_PTR comp, unsigned int width,
VP9_COMP *cpi = (VP9_COMP *)comp;
VP9_COMMON *cm = &cpi->common;
check_initial_width(cpi, NULL);
check_initial_width(cpi, 1, 1);
if (width) {
cm->width = width;
......
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