blob: 06990857a060ef6687abde4718294bb6aa11081d [file] [log] [blame]
Yaowu Xuc27fc142016-08-22 16:08:15 -07001/*
Yaowu Xu2ab7ff02016-09-02 12:04:54 -07002 * Copyright (c) 2016, Alliance for Open Media. All rights reserved
Yaowu Xuc27fc142016-08-22 16:08:15 -07003 *
Yaowu Xu2ab7ff02016-09-02 12:04:54 -07004 * This source code is subject to the terms of the BSD 2 Clause License and
5 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6 * was not distributed with this source code in the LICENSE file, you can
7 * obtain it at www.aomedia.org/license/software. If the Alliance for Open
8 * Media Patent License 1.0 was not distributed with this source code in the
9 * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
Yaowu Xuc27fc142016-08-22 16:08:15 -070010 */
11
Tom Finegan60e653d2018-05-22 11:34:58 -070012#include "config/aom_config.h"
Tom Finegan44702c82018-05-22 13:00:39 -070013#include "config/av1_rtcd.h"
14#include "config/aom_dsp_rtcd.h"
Yaowu Xuc27fc142016-08-22 16:08:15 -070015
16#include "av1/common/idct.h"
17#include "av1/encoder/hybrid_fwd_txfm.h"
18
Urvang Joshi8207b912018-05-07 14:37:51 -070019/* 4-point reversible, orthonormal Walsh-Hadamard in 3.5 adds, 0.5 shifts per
20 pixel. */
21void av1_fwht4x4_c(const int16_t *input, tran_low_t *output, int stride) {
22 int i;
23 tran_high_t a1, b1, c1, d1, e1;
24 const int16_t *ip_pass0 = input;
25 const tran_low_t *ip = NULL;
26 tran_low_t *op = output;
27
28 for (i = 0; i < 4; i++) {
29 a1 = ip_pass0[0 * stride];
30 b1 = ip_pass0[1 * stride];
31 c1 = ip_pass0[2 * stride];
32 d1 = ip_pass0[3 * stride];
33
34 a1 += b1;
35 d1 = d1 - c1;
36 e1 = (a1 - d1) >> 1;
37 b1 = e1 - b1;
38 c1 = e1 - c1;
39 a1 -= c1;
40 d1 += b1;
41 op[0] = (tran_low_t)a1;
42 op[4] = (tran_low_t)c1;
43 op[8] = (tran_low_t)d1;
44 op[12] = (tran_low_t)b1;
45
46 ip_pass0++;
47 op++;
48 }
49 ip = output;
50 op = output;
51
52 for (i = 0; i < 4; i++) {
53 a1 = ip[0];
54 b1 = ip[1];
55 c1 = ip[2];
56 d1 = ip[3];
57
58 a1 += b1;
59 d1 -= c1;
60 e1 = (a1 - d1) >> 1;
61 b1 = e1 - b1;
62 c1 = e1 - c1;
63 a1 -= c1;
64 d1 += b1;
65 op[0] = (tran_low_t)(a1 * UNIT_QUANT_FACTOR);
66 op[1] = (tran_low_t)(c1 * UNIT_QUANT_FACTOR);
67 op[2] = (tran_low_t)(d1 * UNIT_QUANT_FACTOR);
68 op[3] = (tran_low_t)(b1 * UNIT_QUANT_FACTOR);
69
70 ip += 4;
71 op += 4;
72 }
73}
74
75void av1_highbd_fwht4x4_c(const int16_t *input, tran_low_t *output,
76 int stride) {
77 av1_fwht4x4_c(input, output, stride);
78}
79
Yaowu Xuc27fc142016-08-22 16:08:15 -070080static void highbd_fwd_txfm_4x4(const int16_t *src_diff, tran_low_t *coeff,
Lester Lu27319b62017-07-10 16:57:15 -070081 int diff_stride, TxfmParam *txfm_param) {
Yi Luo0f4195c2017-06-27 16:07:28 -070082 int32_t *dst_coeff = (int32_t *)coeff;
Urvang Joshi2283d372017-10-02 17:16:45 -070083 const TX_TYPE tx_type = txfm_param->tx_type;
Lester Lu27319b62017-07-10 16:57:15 -070084 const int bd = txfm_param->bd;
85 if (txfm_param->lossless) {
Yaowu Xuc27fc142016-08-22 16:08:15 -070086 assert(tx_type == DCT_DCT);
Yaowu Xuf883b422016-08-30 14:01:10 -070087 av1_highbd_fwht4x4(src_diff, coeff, diff_stride);
Yaowu Xuc27fc142016-08-22 16:08:15 -070088 return;
89 }
Aniket Dhok7629c382018-10-18 13:02:12 +053090 av1_fwd_txfm2d_4x4(src_diff, dst_coeff, diff_stride, tx_type, bd);
Yaowu Xuc27fc142016-08-22 16:08:15 -070091}
92
Yaowu Xuc27fc142016-08-22 16:08:15 -070093static void highbd_fwd_txfm_4x8(const int16_t *src_diff, tran_low_t *coeff,
Lester Lu27319b62017-07-10 16:57:15 -070094 int diff_stride, TxfmParam *txfm_param) {
Yi Luo0f4195c2017-06-27 16:07:28 -070095 int32_t *dst_coeff = (int32_t *)coeff;
Aniket Dhok7629c382018-10-18 13:02:12 +053096 av1_fwd_txfm2d_4x8(src_diff, dst_coeff, diff_stride, txfm_param->tx_type,
97 txfm_param->bd);
Yaowu Xuc27fc142016-08-22 16:08:15 -070098}
99
100static void highbd_fwd_txfm_8x4(const int16_t *src_diff, tran_low_t *coeff,
Lester Lu27319b62017-07-10 16:57:15 -0700101 int diff_stride, TxfmParam *txfm_param) {
Yi Luo0f4195c2017-06-27 16:07:28 -0700102 int32_t *dst_coeff = (int32_t *)coeff;
Aniket Dhok7629c382018-10-18 13:02:12 +0530103 av1_fwd_txfm2d_8x4(src_diff, dst_coeff, diff_stride, txfm_param->tx_type,
104 txfm_param->bd);
Yaowu Xuc27fc142016-08-22 16:08:15 -0700105}
106
107static void highbd_fwd_txfm_8x16(const int16_t *src_diff, tran_low_t *coeff,
Lester Lu27319b62017-07-10 16:57:15 -0700108 int diff_stride, TxfmParam *txfm_param) {
Yi Luo0f4195c2017-06-27 16:07:28 -0700109 int32_t *dst_coeff = (int32_t *)coeff;
Venkatd04f6c52018-09-12 10:42:33 +0530110 const TX_TYPE tx_type = txfm_param->tx_type;
111 const int bd = txfm_param->bd;
Aniket Dhok7629c382018-10-18 13:02:12 +0530112 av1_fwd_txfm2d_8x16(src_diff, dst_coeff, diff_stride, tx_type, bd);
Yaowu Xuc27fc142016-08-22 16:08:15 -0700113}
114
115static void highbd_fwd_txfm_16x8(const int16_t *src_diff, tran_low_t *coeff,
Lester Lu27319b62017-07-10 16:57:15 -0700116 int diff_stride, TxfmParam *txfm_param) {
Yi Luo0f4195c2017-06-27 16:07:28 -0700117 int32_t *dst_coeff = (int32_t *)coeff;
Venkatd04f6c52018-09-12 10:42:33 +0530118 const TX_TYPE tx_type = txfm_param->tx_type;
119 const int bd = txfm_param->bd;
Aniket Dhok7629c382018-10-18 13:02:12 +0530120 av1_fwd_txfm2d_16x8(src_diff, dst_coeff, diff_stride, tx_type, bd);
Yaowu Xuc27fc142016-08-22 16:08:15 -0700121}
122
123static void highbd_fwd_txfm_16x32(const int16_t *src_diff, tran_low_t *coeff,
Lester Lu27319b62017-07-10 16:57:15 -0700124 int diff_stride, TxfmParam *txfm_param) {
Yi Luo0f4195c2017-06-27 16:07:28 -0700125 int32_t *dst_coeff = (int32_t *)coeff;
Aniket Dhok63adafd2018-10-22 17:51:52 +0530126 av1_fwd_txfm2d_16x32(src_diff, dst_coeff, diff_stride, txfm_param->tx_type,
127 txfm_param->bd);
Yaowu Xuc27fc142016-08-22 16:08:15 -0700128}
129
130static void highbd_fwd_txfm_32x16(const int16_t *src_diff, tran_low_t *coeff,
Lester Lu27319b62017-07-10 16:57:15 -0700131 int diff_stride, TxfmParam *txfm_param) {
Yi Luo0f4195c2017-06-27 16:07:28 -0700132 int32_t *dst_coeff = (int32_t *)coeff;
Aniket Dhok63adafd2018-10-22 17:51:52 +0530133 av1_fwd_txfm2d_32x16(src_diff, dst_coeff, diff_stride, txfm_param->tx_type,
134 txfm_param->bd);
Yaowu Xuc27fc142016-08-22 16:08:15 -0700135}
Yaowu Xuc27fc142016-08-22 16:08:15 -0700136
Debargha Mukherjee845057f2017-11-13 07:03:36 -0800137static void highbd_fwd_txfm_16x4(const int16_t *src_diff, tran_low_t *coeff,
138 int diff_stride, TxfmParam *txfm_param) {
Debargha Mukherjee69f914a2017-11-15 20:58:23 -0800139 int32_t *dst_coeff = (int32_t *)coeff;
Aniket Dhok7629c382018-10-18 13:02:12 +0530140 av1_fwd_txfm2d_16x4(src_diff, dst_coeff, diff_stride, txfm_param->tx_type,
141 txfm_param->bd);
Debargha Mukherjee845057f2017-11-13 07:03:36 -0800142}
143
144static void highbd_fwd_txfm_4x16(const int16_t *src_diff, tran_low_t *coeff,
145 int diff_stride, TxfmParam *txfm_param) {
Debargha Mukherjee69f914a2017-11-15 20:58:23 -0800146 int32_t *dst_coeff = (int32_t *)coeff;
Aniket Dhok7629c382018-10-18 13:02:12 +0530147 av1_fwd_txfm2d_4x16(src_diff, dst_coeff, diff_stride, txfm_param->tx_type,
148 txfm_param->bd);
Debargha Mukherjee845057f2017-11-13 07:03:36 -0800149}
150
151static void highbd_fwd_txfm_32x8(const int16_t *src_diff, tran_low_t *coeff,
152 int diff_stride, TxfmParam *txfm_param) {
Debargha Mukherjee69f914a2017-11-15 20:58:23 -0800153 int32_t *dst_coeff = (int32_t *)coeff;
Aniket Dhok63adafd2018-10-22 17:51:52 +0530154 av1_fwd_txfm2d_32x8(src_diff, dst_coeff, diff_stride, txfm_param->tx_type,
155 txfm_param->bd);
Debargha Mukherjee845057f2017-11-13 07:03:36 -0800156}
157
158static void highbd_fwd_txfm_8x32(const int16_t *src_diff, tran_low_t *coeff,
159 int diff_stride, TxfmParam *txfm_param) {
Debargha Mukherjee69f914a2017-11-15 20:58:23 -0800160 int32_t *dst_coeff = (int32_t *)coeff;
Aniket Dhok63adafd2018-10-22 17:51:52 +0530161 av1_fwd_txfm2d_8x32(src_diff, dst_coeff, diff_stride, txfm_param->tx_type,
162 txfm_param->bd);
Debargha Mukherjee845057f2017-11-13 07:03:36 -0800163}
Debargha Mukherjee845057f2017-11-13 07:03:36 -0800164
Yaowu Xuc27fc142016-08-22 16:08:15 -0700165static void highbd_fwd_txfm_8x8(const int16_t *src_diff, tran_low_t *coeff,
Lester Lu27319b62017-07-10 16:57:15 -0700166 int diff_stride, TxfmParam *txfm_param) {
Yi Luo0f4195c2017-06-27 16:07:28 -0700167 int32_t *dst_coeff = (int32_t *)coeff;
Urvang Joshi2283d372017-10-02 17:16:45 -0700168 const TX_TYPE tx_type = txfm_param->tx_type;
Lester Lu27319b62017-07-10 16:57:15 -0700169 const int bd = txfm_param->bd;
Aniket Dhok7629c382018-10-18 13:02:12 +0530170 av1_fwd_txfm2d_8x8(src_diff, dst_coeff, diff_stride, tx_type, bd);
Yaowu Xuc27fc142016-08-22 16:08:15 -0700171}
172
173static void highbd_fwd_txfm_16x16(const int16_t *src_diff, tran_low_t *coeff,
Lester Lu27319b62017-07-10 16:57:15 -0700174 int diff_stride, TxfmParam *txfm_param) {
Yi Luo0f4195c2017-06-27 16:07:28 -0700175 int32_t *dst_coeff = (int32_t *)coeff;
Urvang Joshi2283d372017-10-02 17:16:45 -0700176 const TX_TYPE tx_type = txfm_param->tx_type;
Lester Lu27319b62017-07-10 16:57:15 -0700177 const int bd = txfm_param->bd;
Aniket Dhok7629c382018-10-18 13:02:12 +0530178 av1_fwd_txfm2d_16x16(src_diff, dst_coeff, diff_stride, tx_type, bd);
Yaowu Xuc27fc142016-08-22 16:08:15 -0700179}
180
Angie Chiang8fd2d7a2017-01-03 15:50:15 -0800181static void highbd_fwd_txfm_32x32(const int16_t *src_diff, tran_low_t *coeff,
Lester Lu27319b62017-07-10 16:57:15 -0700182 int diff_stride, TxfmParam *txfm_param) {
Yi Luo0f4195c2017-06-27 16:07:28 -0700183 int32_t *dst_coeff = (int32_t *)coeff;
Urvang Joshi2283d372017-10-02 17:16:45 -0700184 const TX_TYPE tx_type = txfm_param->tx_type;
Lester Lu27319b62017-07-10 16:57:15 -0700185 const int bd = txfm_param->bd;
Aniket Dhok63adafd2018-10-22 17:51:52 +0530186 av1_fwd_txfm2d_32x32(src_diff, dst_coeff, diff_stride, tx_type, bd);
Yaowu Xuc27fc142016-08-22 16:08:15 -0700187}
Debargha Mukherjee6a47cff2016-11-02 14:57:42 -0700188
Debargha Mukherjee2b435012017-09-28 08:30:35 -0700189static void highbd_fwd_txfm_32x64(const int16_t *src_diff, tran_low_t *coeff,
190 int diff_stride, TxfmParam *txfm_param) {
Hui Su98626d32018-04-13 12:08:48 -0700191 assert(txfm_param->tx_type == DCT_DCT);
Debargha Mukherjee2b435012017-09-28 08:30:35 -0700192 int32_t *dst_coeff = (int32_t *)coeff;
Debargha Mukherjee2b435012017-09-28 08:30:35 -0700193 const int bd = txfm_param->bd;
Satish Kumar Suman02526002018-10-17 17:51:49 +0530194 av1_fwd_txfm2d_32x64(src_diff, dst_coeff, diff_stride, txfm_param->tx_type,
195 bd);
Debargha Mukherjee2b435012017-09-28 08:30:35 -0700196}
197
198static void highbd_fwd_txfm_64x32(const int16_t *src_diff, tran_low_t *coeff,
199 int diff_stride, TxfmParam *txfm_param) {
Hui Su98626d32018-04-13 12:08:48 -0700200 assert(txfm_param->tx_type == DCT_DCT);
Debargha Mukherjee2b435012017-09-28 08:30:35 -0700201 int32_t *dst_coeff = (int32_t *)coeff;
Debargha Mukherjee2b435012017-09-28 08:30:35 -0700202 const int bd = txfm_param->bd;
Satish Kumar Suman02526002018-10-17 17:51:49 +0530203 av1_fwd_txfm2d_64x32(src_diff, dst_coeff, diff_stride, txfm_param->tx_type,
204 bd);
Debargha Mukherjee2b435012017-09-28 08:30:35 -0700205}
Debargha Mukherjee0254fee2017-12-02 09:08:52 -0800206
207static void highbd_fwd_txfm_16x64(const int16_t *src_diff, tran_low_t *coeff,
208 int diff_stride, TxfmParam *txfm_param) {
Hui Su98626d32018-04-13 12:08:48 -0700209 assert(txfm_param->tx_type == DCT_DCT);
Debargha Mukherjee0254fee2017-12-02 09:08:52 -0800210 int32_t *dst_coeff = (int32_t *)coeff;
Debargha Mukherjee0254fee2017-12-02 09:08:52 -0800211 const int bd = txfm_param->bd;
Satish Kumar Suman02526002018-10-17 17:51:49 +0530212 av1_fwd_txfm2d_16x64(src_diff, dst_coeff, diff_stride, DCT_DCT, bd);
Debargha Mukherjee0254fee2017-12-02 09:08:52 -0800213}
214
215static void highbd_fwd_txfm_64x16(const int16_t *src_diff, tran_low_t *coeff,
216 int diff_stride, TxfmParam *txfm_param) {
Hui Su98626d32018-04-13 12:08:48 -0700217 assert(txfm_param->tx_type == DCT_DCT);
Debargha Mukherjee0254fee2017-12-02 09:08:52 -0800218 int32_t *dst_coeff = (int32_t *)coeff;
Debargha Mukherjee0254fee2017-12-02 09:08:52 -0800219 const int bd = txfm_param->bd;
Satish Kumar Suman02526002018-10-17 17:51:49 +0530220 av1_fwd_txfm2d_64x16(src_diff, dst_coeff, diff_stride, DCT_DCT, bd);
Debargha Mukherjee0254fee2017-12-02 09:08:52 -0800221}
222
Debargha Mukherjee6a47cff2016-11-02 14:57:42 -0700223static void highbd_fwd_txfm_64x64(const int16_t *src_diff, tran_low_t *coeff,
Lester Lu27319b62017-07-10 16:57:15 -0700224 int diff_stride, TxfmParam *txfm_param) {
Hui Su98626d32018-04-13 12:08:48 -0700225 assert(txfm_param->tx_type == DCT_DCT);
Yi Luo0f4195c2017-06-27 16:07:28 -0700226 int32_t *dst_coeff = (int32_t *)coeff;
Lester Lu27319b62017-07-10 16:57:15 -0700227 const int bd = txfm_param->bd;
Hui Su98626d32018-04-13 12:08:48 -0700228 av1_fwd_txfm2d_64x64(src_diff, dst_coeff, diff_stride, DCT_DCT, bd);
Debargha Mukherjee6a47cff2016-11-02 14:57:42 -0700229}
Yaowu Xuc27fc142016-08-22 16:08:15 -0700230
hui suf11fb882017-03-27 14:56:33 -0700231void av1_fwd_txfm(const int16_t *src_diff, tran_low_t *coeff, int diff_stride,
Lester Lu27319b62017-07-10 16:57:15 -0700232 TxfmParam *txfm_param) {
Angie Chiang7d8b13e2018-02-07 22:55:45 -0800233 if (txfm_param->bd == 8)
234 av1_lowbd_fwd_txfm(src_diff, coeff, diff_stride, txfm_param);
235 else
236 av1_highbd_fwd_txfm(src_diff, coeff, diff_stride, txfm_param);
237}
238
239void av1_lowbd_fwd_txfm_c(const int16_t *src_diff, tran_low_t *coeff,
240 int diff_stride, TxfmParam *txfm_param) {
241 av1_highbd_fwd_txfm(src_diff, coeff, diff_stride, txfm_param);
Yaowu Xuc27fc142016-08-22 16:08:15 -0700242}
243
hui suf11fb882017-03-27 14:56:33 -0700244void av1_highbd_fwd_txfm(const int16_t *src_diff, tran_low_t *coeff,
Lester Lu27319b62017-07-10 16:57:15 -0700245 int diff_stride, TxfmParam *txfm_param) {
Sarah Parker90024e42017-10-06 16:50:47 -0700246 assert(av1_ext_tx_used[txfm_param->tx_set_type][txfm_param->tx_type]);
Lester Lu27319b62017-07-10 16:57:15 -0700247 const TX_SIZE tx_size = txfm_param->tx_size;
Yaowu Xuc27fc142016-08-22 16:08:15 -0700248 switch (tx_size) {
Debargha Mukherjee6a47cff2016-11-02 14:57:42 -0700249 case TX_64X64:
Lester Lu27319b62017-07-10 16:57:15 -0700250 highbd_fwd_txfm_64x64(src_diff, coeff, diff_stride, txfm_param);
Debargha Mukherjee6a47cff2016-11-02 14:57:42 -0700251 break;
Debargha Mukherjee2b435012017-09-28 08:30:35 -0700252 case TX_32X64:
253 highbd_fwd_txfm_32x64(src_diff, coeff, diff_stride, txfm_param);
254 break;
255 case TX_64X32:
256 highbd_fwd_txfm_64x32(src_diff, coeff, diff_stride, txfm_param);
257 break;
Debargha Mukherjee0254fee2017-12-02 09:08:52 -0800258 case TX_16X64:
259 highbd_fwd_txfm_16x64(src_diff, coeff, diff_stride, txfm_param);
260 break;
261 case TX_64X16:
262 highbd_fwd_txfm_64x16(src_diff, coeff, diff_stride, txfm_param);
263 break;
Yaowu Xuc27fc142016-08-22 16:08:15 -0700264 case TX_32X32:
Lester Lu27319b62017-07-10 16:57:15 -0700265 highbd_fwd_txfm_32x32(src_diff, coeff, diff_stride, txfm_param);
Yaowu Xuc27fc142016-08-22 16:08:15 -0700266 break;
267 case TX_16X16:
Lester Lu27319b62017-07-10 16:57:15 -0700268 highbd_fwd_txfm_16x16(src_diff, coeff, diff_stride, txfm_param);
Yaowu Xuc27fc142016-08-22 16:08:15 -0700269 break;
270 case TX_8X8:
Lester Lu27319b62017-07-10 16:57:15 -0700271 highbd_fwd_txfm_8x8(src_diff, coeff, diff_stride, txfm_param);
Yaowu Xuc27fc142016-08-22 16:08:15 -0700272 break;
Yaowu Xuc27fc142016-08-22 16:08:15 -0700273 case TX_4X8:
Lester Lu27319b62017-07-10 16:57:15 -0700274 highbd_fwd_txfm_4x8(src_diff, coeff, diff_stride, txfm_param);
Yaowu Xuc27fc142016-08-22 16:08:15 -0700275 break;
276 case TX_8X4:
Lester Lu27319b62017-07-10 16:57:15 -0700277 highbd_fwd_txfm_8x4(src_diff, coeff, diff_stride, txfm_param);
Yaowu Xuc27fc142016-08-22 16:08:15 -0700278 break;
279 case TX_8X16:
Lester Lu27319b62017-07-10 16:57:15 -0700280 highbd_fwd_txfm_8x16(src_diff, coeff, diff_stride, txfm_param);
Yaowu Xuc27fc142016-08-22 16:08:15 -0700281 break;
282 case TX_16X8:
Lester Lu27319b62017-07-10 16:57:15 -0700283 highbd_fwd_txfm_16x8(src_diff, coeff, diff_stride, txfm_param);
Yaowu Xuc27fc142016-08-22 16:08:15 -0700284 break;
285 case TX_16X32:
Lester Lu27319b62017-07-10 16:57:15 -0700286 highbd_fwd_txfm_16x32(src_diff, coeff, diff_stride, txfm_param);
Yaowu Xuc27fc142016-08-22 16:08:15 -0700287 break;
288 case TX_32X16:
Lester Lu27319b62017-07-10 16:57:15 -0700289 highbd_fwd_txfm_32x16(src_diff, coeff, diff_stride, txfm_param);
Yaowu Xuc27fc142016-08-22 16:08:15 -0700290 break;
Yaowu Xuc27fc142016-08-22 16:08:15 -0700291 case TX_4X4:
Lester Lu27319b62017-07-10 16:57:15 -0700292 highbd_fwd_txfm_4x4(src_diff, coeff, diff_stride, txfm_param);
Yaowu Xuc27fc142016-08-22 16:08:15 -0700293 break;
Debargha Mukherjee845057f2017-11-13 07:03:36 -0800294 case TX_4X16:
295 highbd_fwd_txfm_4x16(src_diff, coeff, diff_stride, txfm_param);
296 break;
297 case TX_16X4:
298 highbd_fwd_txfm_16x4(src_diff, coeff, diff_stride, txfm_param);
299 break;
300 case TX_8X32:
301 highbd_fwd_txfm_8x32(src_diff, coeff, diff_stride, txfm_param);
302 break;
303 case TX_32X8:
304 highbd_fwd_txfm_32x8(src_diff, coeff, diff_stride, txfm_param);
305 break;
Yaowu Xuc27fc142016-08-22 16:08:15 -0700306 default: assert(0); break;
307 }
308}