diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-10-27 03:23:48 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-10-27 03:23:48 +0000 |
commit | 73b5f8d32198e78366361aa951ef9ce58d1f1d20 (patch) | |
tree | 13dc668296837d6699d8a56dc96bb04dc643fc74 /encoder/ih264e_bitstream.c | |
parent | efc30fd95dbc0c5285ab55aab592c8aad8d2c986 (diff) | |
parent | bfa6d88d8fd5dab60aaa1388f9407690dde06c60 (diff) | |
download | libavc-73b5f8d32198e78366361aa951ef9ce58d1f1d20.tar.gz |
Snap for 11012804 from bfa6d88d8fd5dab60aaa1388f9407690dde06c60 to 24Q1-releaseandroid-14.0.0_r37android-14.0.0_r36android-14.0.0_r35android-14.0.0_r34android-14.0.0_r33android-14.0.0_r32android-14.0.0_r31android-14.0.0_r30android-14.0.0_r29android14-qpr2-s5-releaseandroid14-qpr2-s4-releaseandroid14-qpr2-s3-releaseandroid14-qpr2-s2-releaseandroid14-qpr2-s1-releaseandroid14-qpr2-release
Change-Id: I774d8c3bcc04d5c1e1c5bbf182e7c71fa7f63ae6
Diffstat (limited to 'encoder/ih264e_bitstream.c')
-rw-r--r-- | encoder/ih264e_bitstream.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/encoder/ih264e_bitstream.c b/encoder/ih264e_bitstream.c index 9f73f69..dfdacff 100644 --- a/encoder/ih264e_bitstream.c +++ b/encoder/ih264e_bitstream.c @@ -30,13 +30,13 @@ * ittiam * * @par List of Functions: -* - ih264e_bitstrm_init() -* - ih264e_put_bits() -* - ih264e_put_bit() -* - ih264e_put_rbsp_trailing_bits() -* - ih264e_put_uev() -* - ih264e_put_sev() -* - ih264e_put_nal_start_code_prefix() +* - ih264e_bitstrm_init +* - ih264e_put_bits +* - ih264e_put_bit +* - ih264e_put_rbsp_trailing_bits +* - ih264e_put_uev +* - ih264e_put_sev +* - ih264e_put_nal_start_code_prefix * ****************************************************************************** */ @@ -45,7 +45,7 @@ /* File Includes */ /*****************************************************************************/ -/* System include files */ +/* System Include Files */ #include <stdio.h> #include <string.h> #include <stdlib.h> @@ -53,16 +53,17 @@ #include <stdarg.h> #include <math.h> -/* User include files */ +/* User Include Files */ #include "ih264e_config.h" #include "ih264_typedefs.h" -#include "ih264_platform_macros.h" + #include "ih264_debug.h" -#include "ih264e_error.h" -#include "ih264e_bitstream.h" -#include "ih264_defs.h" #include "ih264_macros.h" +#include "ih264_defs.h" +#include "ih264_platform_macros.h" +#include "ih264e_error.h" +#include "ih264e_bitstream.h" /*****************************************************************************/ /* Function Definitions */ @@ -182,7 +183,6 @@ IH264E_ERROR_T ih264e_put_bits(bitstrm_t *ps_bitstrm, /* 4. insert remaining bits of code starting from msb of cur word */ /* 5. update bitsleft in current word and stream buffer offset */ /********************************************************************/ - IH264E_ERROR_T status = IH264E_SUCCESS; WORD32 i, rem_bits = (code_len - bits_left_in_cw); /* insert parital code corresponding to bits left in cur word */ @@ -193,7 +193,8 @@ IH264E_ERROR_T ih264e_put_bits(bitstrm_t *ps_bitstrm, /* flush the bits in cur word byte by byte and copy to stream */ UWORD8 u1_next_byte = (u4_cur_word >> (i-8)) & 0xFF; - status |= ih264e_put_byte_epb(ps_bitstrm, u1_next_byte); + IH264E_ERROR_T status = ih264e_put_byte_epb(ps_bitstrm, u1_next_byte); + if (status != IH264E_SUCCESS) return status; } /* insert the remaining bits from code val into current word */ @@ -202,7 +203,7 @@ IH264E_ERROR_T ih264e_put_bits(bitstrm_t *ps_bitstrm, /* update the state variables and return success */ ps_bitstrm->u4_cur_word = u4_cur_word; ps_bitstrm->i4_bits_left_in_cw = WORD_SIZE - rem_bits; - return (status); + return (IH264E_SUCCESS); } } @@ -262,7 +263,6 @@ IH264E_ERROR_T ih264e_put_rbsp_trailing_bits(bitstrm_t *ps_bitstrm) UWORD32 u4_cur_word = ps_bitstrm->u4_cur_word; WORD32 bits_left_in_cw = ps_bitstrm->i4_bits_left_in_cw; WORD32 bytes_left_in_cw = (bits_left_in_cw - 1) >> 3; - IH264E_ERROR_T status = IH264E_SUCCESS; /* insert a 1 at the end of current word and flush all the bits */ u4_cur_word |= (1 << (bits_left_in_cw - 1)); @@ -275,7 +275,8 @@ IH264E_ERROR_T ih264e_put_rbsp_trailing_bits(bitstrm_t *ps_bitstrm) /* flush the bits in cur word byte by byte and copy to stream */ UWORD8 u1_next_byte = (u4_cur_word >> (i-8)) & 0xFF; - status |= ih264e_put_byte_epb(ps_bitstrm, u1_next_byte); + IH264E_ERROR_T status = ih264e_put_byte_epb(ps_bitstrm, u1_next_byte); + if (status != IH264E_SUCCESS) return status; } /* Default init values for scratch variables of bitstream context */ @@ -283,7 +284,7 @@ IH264E_ERROR_T ih264e_put_rbsp_trailing_bits(bitstrm_t *ps_bitstrm) ps_bitstrm->i4_bits_left_in_cw = WORD_SIZE; ps_bitstrm->i4_zero_bytes_run = 0; - return (status); + return (IH264E_SUCCESS); } /** |