diff options
author | angiebird <angiebird@google.com> | 2020-07-17 18:43:06 -0700 |
---|---|---|
committer | angiebird <angiebird@google.com> | 2020-07-20 11:07:45 -0700 |
commit | 642f6a195d7c9ec327b2a1445d7dd09dfa4f9bbc (patch) | |
tree | 24f2d821c1b8165f96cd38bb27a6f045baeab5f2 /vp9/encoder/vp9_encoder.h | |
parent | 16935397ee6712c407f0554e80160054d5eb7188 (diff) | |
download | libvpx-642f6a195d7c9ec327b2a1445d7dd09dfa4f9bbc.tar libvpx-642f6a195d7c9ec327b2a1445d7dd09dfa4f9bbc.tar.gz libvpx-642f6a195d7c9ec327b2a1445d7dd09dfa4f9bbc.tar.bz2 libvpx-642f6a195d7c9ec327b2a1445d7dd09dfa4f9bbc.zip |
Add init version of EncodeFrameWithTargetFrameBits()
Will add a unit test in a followup CL.
Change-Id: I6a6354f307c427e1a352be7c6421927323eb5e1b
Diffstat (limited to 'vp9/encoder/vp9_encoder.h')
-rw-r--r-- | vp9/encoder/vp9_encoder.h | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/vp9/encoder/vp9_encoder.h b/vp9/encoder/vp9_encoder.h index 7aa4bf7dc..34ae0a09f 100644 --- a/vp9/encoder/vp9_encoder.h +++ b/vp9/encoder/vp9_encoder.h @@ -563,16 +563,11 @@ static INLINE int gop_command_coding_frame_count( typedef struct ENCODE_COMMAND { int use_external_quantize_index; int external_quantize_index; + int use_external_target_frame_bits; + int target_frame_bits; GOP_COMMAND gop_command; } ENCODE_COMMAND; -static INLINE void encode_command_init(ENCODE_COMMAND *encode_command) { - vp9_zero(*encode_command); - encode_command->use_external_quantize_index = 0; - encode_command->external_quantize_index = -1; - gop_command_off(&encode_command->gop_command); -} - static INLINE void encode_command_set_gop_command( ENCODE_COMMAND *encode_command, GOP_COMMAND gop_command) { encode_command->gop_command = gop_command; @@ -590,6 +585,25 @@ static INLINE void encode_command_reset_external_quantize_index( encode_command->external_quantize_index = -1; } +static INLINE void encode_command_set_target_frame_bits( + ENCODE_COMMAND *encode_command, int target_frame_bits) { + encode_command->use_external_target_frame_bits = 1; + encode_command->target_frame_bits = target_frame_bits; +} + +static INLINE void encode_command_reset_target_frame_bits( + ENCODE_COMMAND *encode_command) { + encode_command->use_external_target_frame_bits = 0; + encode_command->target_frame_bits = -1; +} + +static INLINE void encode_command_init(ENCODE_COMMAND *encode_command) { + vp9_zero(*encode_command); + encode_command_reset_external_quantize_index(encode_command); + encode_command_reset_target_frame_bits(encode_command); + gop_command_off(&encode_command->gop_command); +} + // Returns number of units in size of 4, if not multiple not a multiple of 4, // round it up. For example, size is 7, return 2. static INLINE int get_num_unit_4x4(int size) { return (size + 3) >> 2; } |