diff options
author | John Koleszar <jkoleszar@google.com> | 2013-03-18 13:02:07 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@gerrit.golo.chromium.org> | 2013-03-18 13:02:07 -0700 |
commit | 93529bd7c1ebef578e8a8026aec04ffbec745438 (patch) | |
tree | 830f96336b36294010731d187c9319115bccd95e /vp9/encoder/vp9_onyx_if.c | |
parent | ef179bce61a5c02fb8fc10b73258cf0b68ec86c2 (diff) | |
parent | 8a3f55f2d459b1de112502d32719ffa56fe7604c (diff) | |
download | libvpx-93529bd7c1ebef578e8a8026aec04ffbec745438.tar libvpx-93529bd7c1ebef578e8a8026aec04ffbec745438.tar.gz libvpx-93529bd7c1ebef578e8a8026aec04ffbec745438.tar.bz2 libvpx-93529bd7c1ebef578e8a8026aec04ffbec745438.zip |
Merge "Replace scaling byte with explicit display size" into experimental
Diffstat (limited to 'vp9/encoder/vp9_onyx_if.c')
-rw-r--r-- | vp9/encoder/vp9_onyx_if.c | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c index cd8e74624..c2f2f83e1 100644 --- a/vp9/encoder/vp9_onyx_if.c +++ b/vp9/encoder/vp9_onyx_if.c @@ -1115,6 +1115,9 @@ static void init_config(VP9_PTR ptr, VP9_CONFIG *oxcf) { cm->version = oxcf->Version; vp9_setup_version(cm); + cm->Width = oxcf->Width; + cm->Height = oxcf->Height; + // change includes all joint functionality vp9_change_config(ptr, oxcf); @@ -1299,8 +1302,8 @@ void vp9_change_config(VP9_PTR ptr, VP9_CONFIG *oxcf) { cpi->target_bandwidth = cpi->oxcf.target_bandwidth; - cm->Width = cpi->oxcf.Width; - cm->Height = cpi->oxcf.Height; + cm->display_width = cpi->oxcf.Width; + cm->display_height = cpi->oxcf.Height; // VP8 sharpness level mapping 0-7 (vs 0-10 in general VPx dialogs) if (cpi->oxcf.Sharpness > 7) @@ -1308,18 +1311,6 @@ void vp9_change_config(VP9_PTR ptr, VP9_CONFIG *oxcf) { cm->sharpness_level = cpi->oxcf.Sharpness; - if (cm->horiz_scale != NORMAL || cm->vert_scale != NORMAL) { - int UNINITIALIZED_IS_SAFE(hr), UNINITIALIZED_IS_SAFE(hs); - int UNINITIALIZED_IS_SAFE(vr), UNINITIALIZED_IS_SAFE(vs); - - Scale2Ratio(cm->horiz_scale, &hr, &hs); - Scale2Ratio(cm->vert_scale, &vr, &vs); - - // always go to the next whole number - cm->Width = (hs - 1 + cpi->oxcf.Width * hr) / hs; - cm->Height = (vs - 1 + cpi->oxcf.Height * vr) / vs; - } - // Increasing the size of the frame beyond the first seen frame, or some // otherwise signalled maximum size, is not supported. // TODO(jkoleszar): exit gracefully. @@ -4145,6 +4136,7 @@ int vp9_set_internal_size(VP9_PTR comp, VPX_SCALING horiz_mode, VPX_SCALING vert_mode) { VP9_COMP *cpi = (VP9_COMP *) comp; VP9_COMMON *cm = &cpi->common; + int hr = 0, hs = 0, vr = 0, vs = 0; if (horiz_mode > ONETWO) return -1; @@ -4152,20 +4144,13 @@ int vp9_set_internal_size(VP9_PTR comp, if (vert_mode > ONETWO) return -1; - if (cm->horiz_scale != horiz_mode || cm->vert_scale != vert_mode) { - int UNINITIALIZED_IS_SAFE(hr), UNINITIALIZED_IS_SAFE(hs); - int UNINITIALIZED_IS_SAFE(vr), UNINITIALIZED_IS_SAFE(vs); - - cm->horiz_scale = horiz_mode; - cm->vert_scale = vert_mode; + Scale2Ratio(horiz_mode, &hr, &hs); + Scale2Ratio(vert_mode, &vr, &vs); - Scale2Ratio(cm->horiz_scale, &hr, &hs); - Scale2Ratio(cm->vert_scale, &vr, &vs); + // always go to the next whole number + cm->Width = (hs - 1 + cpi->oxcf.Width * hr) / hs; + cm->Height = (vs - 1 + cpi->oxcf.Height * vr) / vs; - // always go to the next whole number - cm->Width = (hs - 1 + cpi->oxcf.Width * hr) / hs; - cm->Height = (vs - 1 + cpi->oxcf.Height * vr) / vs; - } assert(cm->Width <= cpi->initial_width); assert(cm->Height <= cpi->initial_height); update_frame_size(cpi); |