diff options
author | Chamarthi Kishore <chamarthi.kishore@ittiam.com> | 2019-10-11 18:53:50 +0530 |
---|---|---|
committer | Chamarthi Kishore <chamarthi.kishore@ittiam.com> | 2019-10-24 17:54:31 +0530 |
commit | 95a2113e4b42b9f393ae2724c3b529d8eded17e6 (patch) | |
tree | 079d129970d09d96a60ea9961d257bef51367063 /encoder/ih264e_encode_header.h | |
parent | ad2eaf8c7da083614b9658b23fb775c62a905179 (diff) | |
download | libavc-95a2113e4b42b9f393ae2724c3b529d8eded17e6.tar.gz |
libavc: Handling of Error propagation
This commit has changes to Error return propagation to
the caller functions.
Test: avcenc -c enc.cfg, avcdec -c dec.cfg
Bug: 142545567
Change-Id: I015ebe03e753a0edc1bf8bfc167180ead63193e1
Diffstat (limited to 'encoder/ih264e_encode_header.h')
-rw-r--r-- | encoder/ih264e_encode_header.h | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/encoder/ih264e_encode_header.h b/encoder/ih264e_encode_header.h index e5a2133..2f7ac91 100644 --- a/encoder/ih264e_encode_header.h +++ b/encoder/ih264e_encode_header.h @@ -49,9 +49,15 @@ * bitstream ****************************************************************************** */ -#define PUT_BITS(ps_bitstrm, code_val, code_len, ret_val, syntax_string) \ - ENTROPY_TRACE(syntax_string, code_val);\ - ret_val |= ih264e_put_bits((ps_bitstrm), (code_val), (code_len)) +#define PUT_BITS(ps_bitstrm, code_val, code_len, ret_val, syntax_string) \ + { \ + ENTROPY_TRACE(syntax_string, code_val); \ + ret_val = ih264e_put_bits((ps_bitstrm), (code_val), (code_len)); \ + if(ret_val != IH264E_SUCCESS) \ + { \ + return ret_val; \ + } \ + } /** ****************************************************************************** @@ -60,10 +66,15 @@ * signed numbers ****************************************************************************** */ -#define PUT_BITS_UEV(ps_bitstrm, code_val, ret_val, syntax_string) \ - ENTROPY_TRACE(syntax_string, code_val);\ - ret_val |= ih264e_put_uev((ps_bitstrm), (code_val)) - +#define PUT_BITS_UEV(ps_bitstrm, code_val, ret_val, syntax_string) \ + { \ + ENTROPY_TRACE(syntax_string, code_val); \ + ret_val = ih264e_put_uev((ps_bitstrm), (code_val)); \ + if(ret_val != IH264E_SUCCESS) \ + { \ + return ret_val; \ + } \ + } /** ****************************************************************************** * @brief Macro to put a code with specified number of bits into the @@ -71,10 +82,15 @@ * signed numbers ****************************************************************************** */ -#define PUT_BITS_SEV(ps_bitstrm, code_val, ret_val, syntax_string) \ - ENTROPY_TRACE(syntax_string, code_val);\ - ret_val |= ih264e_put_sev((ps_bitstrm), (code_val)) - +#define PUT_BITS_SEV(ps_bitstrm, code_val, ret_val, syntax_string) \ + { \ + ENTROPY_TRACE(syntax_string, code_val); \ + ret_val = ih264e_put_sev((ps_bitstrm), (code_val)); \ + if(ret_val != IH264E_SUCCESS) \ + { \ + return ret_val; \ + } \ + } /*****************************************************************************/ /* Extern Function Declarations */ |