* Prepare bundle for decoding data. * * @param gb context for reading bits * @param c decoder context * @param bundle_num number of the bundle to initialize */
| 290 | * @param bundle_num number of the bundle to initialize |
| 291 | */ |
| 292 | static int read_bundle(GetBitContext *gb, BinkContext *c, int bundle_num) |
| 293 | { |
| 294 | int i; |
| 295 | |
| 296 | if (bundle_num == BINK_SRC_COLORS) { |
| 297 | for (i = 0; i < 16; i++) { |
| 298 | int ret = read_tree(gb, &c->col_high[i]); |
| 299 | if (ret < 0) |
| 300 | return ret; |
| 301 | } |
| 302 | c->col_lastval = 0; |
| 303 | } |
| 304 | if (bundle_num != BINK_SRC_INTRA_DC && bundle_num != BINK_SRC_INTER_DC) { |
| 305 | int ret = read_tree(gb, &c->bundle[bundle_num].tree); |
| 306 | if (ret < 0) |
| 307 | return ret; |
| 308 | } |
| 309 | c->bundle[bundle_num].cur_dec = |
| 310 | c->bundle[bundle_num].cur_ptr = c->bundle[bundle_num].data; |
| 311 | |
| 312 | return 0; |
| 313 | } |
| 314 | |
| 315 | /** |
| 316 | * common check before starting decoding bundle data |
no test coverage detected