diff options
author | Yunqing Wang <yunqingwang@google.com> | 2011-10-25 15:14:16 -0400 |
---|---|---|
committer | Yunqing Wang <yunqingwang@google.com> | 2011-12-05 17:59:42 -0500 |
commit | aa7335e610b961626f77130bc99b24de1031601d (patch) | |
tree | cfdd17dd049a005e30ec8d515fd6d303e035754c /vp8/encoder/onyx_int.h | |
parent | 6127af60c1eb4f20b03a4a34eb53704592194bed (diff) | |
download | libvpx-aa7335e610b961626f77130bc99b24de1031601d.tar libvpx-aa7335e610b961626f77130bc99b24de1031601d.tar.gz libvpx-aa7335e610b961626f77130bc99b24de1031601d.tar.bz2 libvpx-aa7335e610b961626f77130bc99b24de1031601d.zip |
Multiple-resolution encoder
The example encoder down-samples the input video frames a number of
times with a down-sampling factor, and then encodes and outputs
bitstreams with different resolutions.
Support arbitrary down-sampling factor, and down-sampling factor
can be different for each encoding level.
For example, the encoder can be tested as follows.
1. Configure with multi-resolution encoding enabled:
../libvpx/configure --target=x86-linux-gcc --disable-codecs
--enable-vp8 --enable-runtime_cpu_detect --enable-debug
--disable-install-docs --enable-error-concealment
--enable-multi-res-encoding
2. Run make
3. Encode:
If input video is 1280x720, run:
./vp8_multi_resolution_encoder 1280 720 input.yuv 1.ivf 2.ivf 3.ivf 1
(output: 1.ivf(1280x720); 2.ivf(640x360); 3.ivf(320x180).
The last parameter is set to 1/0 to show/not show PSNR.)
4. Decode:
./simple_decoder 1.ivf 1.yuv
./simple_decoder 2.ivf 2.yuv
./simple_decoder 3.ivf 3.yuv
5. View video:
mplayer 1.yuv -demuxer rawvideo -rawvideo w=1280:h=720 -loop 0 -fps 30
mplayer 2.yuv -demuxer rawvideo -rawvideo w=640:h=360 -loop 0 -fps 30
mplayer 3.yuv -demuxer rawvideo -rawvideo w=320:h=180 -loop 0 -fps 30
The encoding parameters can be modified in vp8_multi_resolution_encoder.c,
for example, target bitrate, frame rate...
Modified API. John helped a lot with that. Thanks!
Change-Id: I03be9a51167eddf94399f92d269599fb3f3d54f5
Diffstat (limited to 'vp8/encoder/onyx_int.h')
-rw-r--r-- | vp8/encoder/onyx_int.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/vp8/encoder/onyx_int.h b/vp8/encoder/onyx_int.h index 202f61471..ca36c85af 100644 --- a/vp8/encoder/onyx_int.h +++ b/vp8/encoder/onyx_int.h @@ -58,6 +58,9 @@ #define MAX_PERIODICITY 16 +#define MAX(x,y) (((x)>(y))?(x):(y)) +#define MIN(x,y) (((x)<(y))?(x):(y)) + typedef struct { int kf_indicated; @@ -679,6 +682,11 @@ typedef struct VP8_COMP double total_ssimg_v_in_layer[MAX_LAYERS]; double total_ssimg_all_in_layer[MAX_LAYERS]; +#if CONFIG_MULTI_RES_ENCODING + /* Number of MBs per row at lower-resolution level */ + int mr_low_res_mb_cols; +#endif + } VP8_COMP; void control_data_rate(VP8_COMP *cpi); |