Lines Matching refs:dc
226 int dc, val, pos;
234 dc = get_vlc2(gb, c->dc_vlc[is_chroma].table, 9, 2);
235 if (dc < 0)
237 if (dc)
238 dc = get_xbits(gb, dc);
239 dc = dc * qmat[0] + c->prev_dc[plane];
240 block[0] = dc;
241 c->prev_dc[plane] = dc;
481 static inline int is_pixel_on_stack(const ePICContext *dc, uint32_t pix)
485 for (i = 0; i < dc->stack_pos; i++)
486 if (dc->stack[i] == pix)
489 return i != dc->stack_pos;
494 static inline int epic_decode_component_pred(ePICContext *dc,
497 unsigned delta = ff_els_decode_unsigned(&dc->els_ctx, &dc->unsigned_rung);
501 static uint32_t epic_decode_pixel_pred(ePICContext *dc, int x, int y,
518 G = epic_decode_component_pred(dc, GN, GW, GNW);
520 R = G + epic_decode_component_pred(dc,
525 B = G + epic_decode_component_pred(dc,
535 delta = ff_els_decode_unsigned(&dc->els_ctx, &dc->unsigned_rung);
538 delta = ff_els_decode_unsigned(&dc->els_ctx, &dc->unsigned_rung);
541 delta = ff_els_decode_unsigned(&dc->els_ctx, &dc->unsigned_rung);
553 static int epic_predict_pixel(ePICContext *dc, uint8_t *rung,
556 if (!ff_els_decode_bit(&dc->els_ctx, rung)) {
560 dc->stack[dc->stack_pos++ & EPIC_PIX_STACK_MAX] = pix;
564 static int epic_handle_edges(ePICContext *dc, int x, int y,
572 *pPix = (ff_els_decode_unsigned(&dc->els_ctx, &dc->unsigned_rung) << R_shift) |
573 (ff_els_decode_unsigned(&dc->els_ctx, &dc->unsigned_rung) << G_shift) |
574 (ff_els_decode_unsigned(&dc->els_ctx, &dc->unsigned_rung) << B_shift);
580 if (epic_predict_pixel(dc, &dc->W_flag_rung, pPix, pix))
586 if (!dc->stack_pos || dc->stack[0] != pix) {
587 if (epic_predict_pixel(dc, &dc->N_flag_rung, pPix, pix))
595 static int epic_decode_run_length(ePICContext *dc, int x, int y, int tile_width,
608 if (dc->next_run_pos == x) {
620 WWneW = ff_els_decode_bit(&dc->els_ctx, &dc->W_ctx_rung[idx]);
626 dc->stack[dc->stack_pos++ & EPIC_PIX_STACK_MAX] = W;
647 if (!is_pixel_on_stack(dc, N)) {
657 if (!ff_els_decode_bit(&dc->els_ctx, &dc->N_ctx_rung[idx])) {
668 if (!is_pixel_on_stack(dc, N))
669 dc->stack[dc->stack_pos++ & EPIC_PIX_STACK_MAX] = N;
690 if (ff_els_decode_bit(&dc->els_ctx, &dc->prev_row_rung[idx]))
697 ff_els_decode_bit(&dc->els_ctx,
698 flag ? &dc->runlen_one
699 : &dc->runlen_zeroes[pos])) {
723 WWneW = ff_els_decode_bit(&dc->els_ctx, &dc->W_ctx_rung[idx]);
726 dc->next_run_pos = x + *pRun;
730 static int epic_predict_pixel2(ePICContext *dc, uint8_t *rung,
733 if (ff_els_decode_bit(&dc->els_ctx, rung)) {
737 dc->stack[dc->stack_pos++ & EPIC_PIX_STACK_MAX] = pix;
741 static int epic_predict_from_NW_NE(ePICContext *dc, int x, int y, int run,
750 if (NW != curr_row[x - 1] && NW != above_row[x] && !is_pixel_on_stack(dc, NW)) {
751 if (epic_predict_pixel2(dc, &dc->nw_pred_rung[NW & 0xFF], pPix, NW))
760 if (NE != above_row[pos] && !is_pixel_on_stack(dc, NE)) {
761 if (epic_predict_pixel2(dc, &dc->ne_pred_rung[NE & 0xFF], pPix, NE))
769 static int epic_decode_from_cache(ePICContext *dc, uint32_t W, uint32_t *pPix)
772 ePICPixHashElem *hash_elem = epic_hash_find(&dc->hash, W);
779 if (!is_pixel_on_stack(dc, list->pixel)) {
780 if (ff_els_decode_bit(&dc->els_ctx, &list->rung)) {
789 dc->stack[dc->stack_pos++ & EPIC_PIX_STACK_MAX] = list->pixel;
798 static int epic_decode_tile(ePICContext *dc, uint8_t *out, int tile_height,
810 for (x = 0, dc->next_run_pos = 0; x < tile_width;) {
811 if (dc->els_ctx.err)
819 !epic_cache_entries_for_pixel(&dc->hash, pix)) {
820 curr_row[x] = epic_decode_pixel_pred(dc, x, y, curr_row, above_row);
824 dc->stack_pos = 0; // empty stack
828 got_pixel = epic_handle_edges(dc, x, y, curr_row, above_row, &pix);
830 got_pixel = epic_decode_run_length(dc, x, y, tile_width,
837 if (!got_pixel && !epic_predict_from_NW_NE(dc, x, y, run,
841 if (!x || !epic_decode_from_cache(dc, ref_pix, &pix)) {
842 pix = epic_decode_pixel_pred(dc, x, y, curr_row, above_row);
843 if (is_pixel_on_stack(dc, pix))
847 int ret = epic_add_pixel_to_cache(&dc->hash,