diff options
author | Linfeng Zhang <linfengz@google.com> | 2018-05-01 17:57:51 -0700 |
---|---|---|
committer | Linfeng Zhang <linfengz@google.com> | 2018-05-01 17:57:51 -0700 |
commit | 28c563a11c4c1b429ce464eb8076282da641e21e (patch) | |
tree | ae3c019af960041aff3f8503e82def0f5f6db56a /vp9/encoder/vp9_ratectrl.c | |
parent | e4408a07bea94740f5fc1cd05e62aa2dda5f57ff (diff) | |
download | libvpx-28c563a11c4c1b429ce464eb8076282da641e21e.tar libvpx-28c563a11c4c1b429ce464eb8076282da641e21e.tar.gz libvpx-28c563a11c4c1b429ce464eb8076282da641e21e.tar.bz2 libvpx-28c563a11c4c1b429ce464eb8076282da641e21e.zip |
Clean switch cases in vp9 encoder
To save a branch.
Change-Id: Ifa2be7583e95c6991784731c654bbd4cce31e993
Diffstat (limited to 'vp9/encoder/vp9_ratectrl.c')
-rw-r--r-- | vp9/encoder/vp9_ratectrl.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c index 9fbb48817..599337f80 100644 --- a/vp9/encoder/vp9_ratectrl.c +++ b/vp9/encoder/vp9_ratectrl.c @@ -48,18 +48,16 @@ #define MAX_BPB_FACTOR 50 #if CONFIG_VP9_HIGHBITDEPTH -#define ASSIGN_MINQ_TABLE(bit_depth, name) \ - do { \ - switch (bit_depth) { \ - case VPX_BITS_8: name = name##_8; break; \ - case VPX_BITS_10: name = name##_10; break; \ - case VPX_BITS_12: name = name##_12; break; \ - default: \ - assert(0 && \ - "bit_depth should be VPX_BITS_8, VPX_BITS_10" \ - " or VPX_BITS_12"); \ - name = NULL; \ - } \ +#define ASSIGN_MINQ_TABLE(bit_depth, name) \ + do { \ + switch (bit_depth) { \ + case VPX_BITS_8: name = name##_8; break; \ + case VPX_BITS_10: name = name##_10; break; \ + default: \ + assert(bit_depth == VPX_BITS_12); \ + name = name##_12; \ + break; \ + } \ } while (0) #else #define ASSIGN_MINQ_TABLE(bit_depth, name) \ @@ -167,10 +165,9 @@ double vp9_convert_qindex_to_q(int qindex, vpx_bit_depth_t bit_depth) { switch (bit_depth) { case VPX_BITS_8: return vp9_ac_quant(qindex, 0, bit_depth) / 4.0; case VPX_BITS_10: return vp9_ac_quant(qindex, 0, bit_depth) / 16.0; - case VPX_BITS_12: return vp9_ac_quant(qindex, 0, bit_depth) / 64.0; default: - assert(0 && "bit_depth should be VPX_BITS_8, VPX_BITS_10 or VPX_BITS_12"); - return -1.0; + assert(bit_depth == VPX_BITS_12); + return vp9_ac_quant(qindex, 0, bit_depth) / 64.0; } #else return vp9_ac_quant(qindex, 0, bit_depth) / 4.0; |