From f7bd1274e38ae8ec631887841ea27a10ba366ba2 Mon Sep 17 00:00:00 2001 From: Adrian Grange Date: Wed, 9 Apr 2014 14:51:29 -0700 Subject: Enable vpxenc to specify internal coded frame size Added command line flags "resize-width" & "resize-height" to allow the user to specify the frame size to encode at. These two flags are ignored if the "resize-allowed" switch is not set to 1. All frames in the clip are then encoded at this size, which must be smaller than the raw frame size. Change-Id: I3d64bd9303d5c0bd678461a866a1ea621700d744 --- vp9/encoder/vp9_onyx_if.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'vp9/encoder/vp9_onyx_if.c') diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c index 1d70538c6..4b2aa8735 100644 --- a/vp9/encoder/vp9_onyx_if.c +++ b/vp9/encoder/vp9_onyx_if.c @@ -2997,6 +2997,15 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags, cm->frame_flags = *frame_flags; + if (cpi->pass == 2 && + cm->current_video_frame == 0 && + cpi->oxcf.allow_spatial_resampling && + cpi->oxcf.end_usage == USAGE_LOCAL_FILE_PLAYBACK) { + // Internal scaling is triggered on the first frame. + vp9_set_size_literal(cpi, cpi->oxcf.scaled_frame_width, + cpi->oxcf.scaled_frame_height); + } + // Reset the frame pointers to the current frame size vp9_realloc_frame_buffer(get_frame_new_buffer(cm), cm->width, cm->height, -- cgit v1.2.3