summaryrefslogtreecommitdiff
path: root/vp9/vp9_cx_iface.c
diff options
context:
space:
mode:
authorCheng Chen <chengchen@google.com>2022-03-30 15:47:17 -0700
committerCheng Chen <chengchen@google.com>2022-03-30 16:29:29 -0700
commit2c32425851cb89a1623ac7f3cf3d7bbba7aa32c6 (patch)
tree353fd2b2ad5a282d2d88d693f9e65d07dbe80ebc /vp9/vp9_cx_iface.c
parent1239be9e5faf3f7c1603548ed669af35639b74f8 (diff)
downloadlibvpx-2c32425851cb89a1623ac7f3cf3d7bbba7aa32c6.tar
libvpx-2c32425851cb89a1623ac7f3cf3d7bbba7aa32c6.tar.gz
libvpx-2c32425851cb89a1623ac7f3cf3d7bbba7aa32c6.tar.bz2
libvpx-2c32425851cb89a1623ac7f3cf3d7bbba7aa32c6.zip
L2E: Make SimpleEncode take vp9 level as an input
Level conformance is standadized in vp9. If a specific target level is set, the vp9 encoder is required to produce conformant bitstream with limit on frame size, rate, min alt-ref distance, etc. This change makes the SimpleEncode environment take the target level as an input. To make existing tests pass, we set the level to 0. Change-Id: Ia35224f75c2fe50338b5b86a50c84355f5daf6fd
Diffstat (limited to 'vp9/vp9_cx_iface.c')
-rw-r--r--vp9/vp9_cx_iface.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/vp9/vp9_cx_iface.c b/vp9/vp9_cx_iface.c
index 76274437c..b809ab3e6 100644
--- a/vp9/vp9_cx_iface.c
+++ b/vp9/vp9_cx_iface.c
@@ -2143,6 +2143,7 @@ static vp9_extracfg get_extra_cfg() {
VP9EncoderConfig vp9_get_encoder_config(int frame_width, int frame_height,
vpx_rational_t frame_rate,
int target_bitrate, int encode_speed,
+ int target_level,
vpx_enc_pass enc_pass) {
/* This function will generate the same VP9EncoderConfig used by the
* vpxenc command given below.
@@ -2154,6 +2155,7 @@ VP9EncoderConfig vp9_get_encoder_config(int frame_width, int frame_height,
* FPS: frame_rate
* BITRATE: target_bitrate
* CPU_USED:encode_speed
+ * TARGET_LEVEL: target_level
*
* INPUT, OUTPUT, LIMIT will not affect VP9EncoderConfig
*
@@ -2166,6 +2168,7 @@ VP9EncoderConfig vp9_get_encoder_config(int frame_width, int frame_height,
* FPS=30/1
* LIMIT=150
* CPU_USED=0
+ * TARGET_LEVEL=0
* ./vpxenc --limit=$LIMIT --width=$WIDTH --height=$HEIGHT --fps=$FPS
* --lag-in-frames=25 \
* --codec=vp9 --good --cpu-used=CPU_USED --threads=0 --profile=0 \
@@ -2174,7 +2177,7 @@ VP9EncoderConfig vp9_get_encoder_config(int frame_width, int frame_height,
* --minsection-pct=0 --maxsection-pct=150 --arnr-maxframes=7 --psnr \
* --arnr-strength=5 --sharpness=0 --undershoot-pct=100 --overshoot-pct=100 \
* --frame-parallel=0 --tile-columns=0 --cpu-used=0 --end-usage=vbr \
- * --target-bitrate=$BITRATE -o $OUTPUT $INPUT
+ * --target-bitrate=$BITRATE --target-level=0 -o $OUTPUT $INPUT
*/
VP9EncoderConfig oxcf;
@@ -2192,6 +2195,7 @@ VP9EncoderConfig vp9_get_encoder_config(int frame_width, int frame_height,
oxcf.frame_parallel_decoding_mode = 0;
oxcf.two_pass_vbrmax_section = 150;
oxcf.speed = abs(encode_speed);
+ oxcf.target_level = target_level;
return oxcf;
}