/third_party/mesa3d/src/util/ |
D | vl_vlc.h | 87 vl_vlc_next_input(struct vl_vlc *vlc) in vl_vlc_next_input() argument 89 unsigned len = vlc->sizes[0]; in vl_vlc_next_input() 91 assert(vlc); in vl_vlc_next_input() 92 assert(vlc->bytes_left); in vl_vlc_next_input() 94 if (len < vlc->bytes_left) in vl_vlc_next_input() 95 vlc->bytes_left -= len; in vl_vlc_next_input() 97 len = vlc->bytes_left; in vl_vlc_next_input() 98 vlc->bytes_left = 0; in vl_vlc_next_input() 101 vlc->data = (const uint8_t *) vlc->inputs[0]; in vl_vlc_next_input() 102 vlc->end = vlc->data + len; in vl_vlc_next_input() [all …]
|
/third_party/mesa3d/src/gallium/frontends/omx/bellagio/ |
D | vid_dec_mpeg12.c | 62 static void vid_dec_mpeg12_Decode(vid_dec_PrivateType *priv, struct vl_vlc *vlc, unsigned min_bits_… 143 static void vid_dec_mpeg12_Decode(vid_dec_PrivateType *priv, struct vl_vlc *vlc, unsigned min_bits_… in vid_dec_mpeg12_Decode() argument 148 if (!vl_vlc_search_byte(vlc, vl_vlc_bits_left(vlc) - min_bits_left, 0x00)) in vid_dec_mpeg12_Decode() 151 if (vl_vlc_peekbits(vlc, 24) != 0x000001) { in vid_dec_mpeg12_Decode() 152 vl_vlc_eatbits(vlc, 8); in vid_dec_mpeg12_Decode() 157 unsigned bytes = priv->bytes_left - (vl_vlc_bits_left(vlc) / 8); in vid_dec_mpeg12_Decode() 163 vl_vlc_eatbits(vlc, 24); in vid_dec_mpeg12_Decode() 164 code = vl_vlc_get_uimsbf(vlc, 8); in vid_dec_mpeg12_Decode() 171 vl_vlc_fillbits(vlc); in vid_dec_mpeg12_Decode() 174 vl_vlc_get_uimsbf(vlc, 12); in vid_dec_mpeg12_Decode() [all …]
|
D | vid_dec_av1.c | 39 static unsigned av1_f(struct vl_vlc *vlc, unsigned n) in av1_f() argument 41 unsigned valid = vl_vlc_valid_bits(vlc); in av1_f() 47 vl_vlc_fillbits(vlc); in av1_f() 49 return vl_vlc_get_uimsbf(vlc, n); in av1_f() 52 static unsigned av1_uvlc(struct vl_vlc *vlc) in av1_uvlc() argument 58 bool done = av1_f(vlc, 1); in av1_uvlc() 67 value = av1_f(vlc, leadingZeros); in av1_uvlc() 72 static int av1_le(struct vl_vlc *vlc, const unsigned n) in av1_le() argument 78 byte = av1_f(vlc, 8); in av1_le() 85 static unsigned av1_uleb128(struct vl_vlc *vlc) in av1_uleb128() argument [all …]
|
D | vid_dec_h265.c | 914 struct vl_vlc *vlc, in vid_dec_h265_Decode() argument 921 if (!vl_vlc_search_byte(vlc, vl_vlc_bits_left(vlc) - min_bits_left, 0x00)) in vid_dec_h265_Decode() 924 if (vl_vlc_peekbits(vlc, 24) != 0x000001) { in vid_dec_h265_Decode() 925 vl_vlc_eatbits(vlc, 8); in vid_dec_h265_Decode() 930 unsigned bytes = priv->bytes_left - (vl_vlc_bits_left(vlc) / 8); in vid_dec_h265_Decode() 938 vl_vlc_eatbits(vlc, 24); in vid_dec_h265_Decode() 941 vl_vlc_eatbits(vlc, 1); in vid_dec_h265_Decode() 943 if (vl_vlc_valid_bits(vlc) < 15) in vid_dec_h265_Decode() 944 vl_vlc_fillbits(vlc); in vid_dec_h265_Decode() 946 nal_unit_type = vl_vlc_get_uimsbf(vlc, 6); in vid_dec_h265_Decode() [all …]
|
/third_party/mesa3d/src/gallium/frontends/va/ |
D | picture_vp9.c | 123 static unsigned vp9_u(struct vl_vlc *vlc, unsigned n) in vp9_u() argument 125 unsigned valid = vl_vlc_valid_bits(vlc); in vp9_u() 131 vl_vlc_fillbits(vlc); in vp9_u() 133 return vl_vlc_get_uimsbf(vlc, n); in vp9_u() 136 static signed vp9_s(struct vl_vlc *vlc, unsigned n) in vp9_s() argument 141 v = vp9_u(vlc, n); in vp9_s() 142 s = vp9_u(vlc, 1); in vp9_s() 147 static void bitdepth_colorspace_sampling(struct vl_vlc *vlc, unsigned profile) in bitdepth_colorspace_sampling() argument 153 vp9_u(vlc, 1); in bitdepth_colorspace_sampling() 155 cs = vp9_u(vlc, 3); in bitdepth_colorspace_sampling() [all …]
|
D | picture_hevc_enc.c | 284 struct vl_vlc vlc = {0}; in vlVaHandleVAEncPackedHeaderDataBufferTypeHEVC() local 285 vl_vlc_init(&vlc, 1, (const void * const*)&buf->data, &buf->size); in vlVaHandleVAEncPackedHeaderDataBufferTypeHEVC() 287 while (vl_vlc_bits_left(&vlc) > 0) { in vlVaHandleVAEncPackedHeaderDataBufferTypeHEVC() 289 for (int i = 0; i < 64 && vl_vlc_bits_left(&vlc) >= 24; ++i) { in vlVaHandleVAEncPackedHeaderDataBufferTypeHEVC() 290 if (vl_vlc_peekbits(&vlc, 24) == 0x000001) in vlVaHandleVAEncPackedHeaderDataBufferTypeHEVC() 292 vl_vlc_eatbits(&vlc, 8); in vlVaHandleVAEncPackedHeaderDataBufferTypeHEVC() 293 vl_vlc_fillbits(&vlc); in vlVaHandleVAEncPackedHeaderDataBufferTypeHEVC() 295 vl_vlc_eatbits(&vlc, 24); /* eat the startcode */ in vlVaHandleVAEncPackedHeaderDataBufferTypeHEVC() 297 if (vl_vlc_valid_bits(&vlc) < 15) in vlVaHandleVAEncPackedHeaderDataBufferTypeHEVC() 298 vl_vlc_fillbits(&vlc); in vlVaHandleVAEncPackedHeaderDataBufferTypeHEVC() [all …]
|
/third_party/ffmpeg/libavcodec/ |
D | bitstream.c | 115 static int alloc_table(VLC *vlc, int size, int use_static) in alloc_table() argument 117 int index = vlc->table_size; in alloc_table() 119 vlc->table_size += size; in alloc_table() 120 if (vlc->table_size > vlc->table_allocated) { in alloc_table() 123 vlc->table_allocated += (1 << vlc->bits); in alloc_table() 124 vlc->table = av_realloc_f(vlc->table, vlc->table_allocated, sizeof(VLC_TYPE) * 2); in alloc_table() 125 if (!vlc->table) { in alloc_table() 126 vlc->table_allocated = 0; in alloc_table() 127 vlc->table_size = 0; in alloc_table() 130 …memset(vlc->table + vlc->table_allocated - (1 << vlc->bits), 0, sizeof(VLC_TYPE) * 2 << vlc->bits); in alloc_table() [all …]
|
D | vlc.h | 38 #define init_vlc(vlc, nb_bits, nb_codes, \ argument 42 ff_init_vlc_sparse(vlc, nb_bits, nb_codes, \ 47 int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, 82 int ff_init_vlc_from_lengths(VLC *vlc, int nb_bits, int nb_codes, 87 void ff_free_vlc(VLC *vlc); 98 #define INIT_CUSTOM_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \ argument 102 (vlc)->table = table; \ 103 (vlc)->table_allocated = static_size; \ 104 ff_init_vlc_sparse(vlc, bits, a, b, c, d, e, f, g, h, i, j, \ 108 #define INIT_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, h, i, j, static_size) \ argument [all …]
|
D | sheervideo.c | 39 VLC vlc[2]; member 68 a = get_vlc2(gb, s->vlc[1].table, SHEER_VLC_BITS, 2); in decode_ca4i() 69 y = get_vlc2(gb, s->vlc[0].table, SHEER_VLC_BITS, 2); in decode_ca4i() 70 u = get_vlc2(gb, s->vlc[1].table, SHEER_VLC_BITS, 2); in decode_ca4i() 71 v = get_vlc2(gb, s->vlc[1].table, SHEER_VLC_BITS, 2); in decode_ca4i() 111 a = get_vlc2(gb, s->vlc[1].table, SHEER_VLC_BITS, 2); in decode_ca4p() 112 y = get_vlc2(gb, s->vlc[0].table, SHEER_VLC_BITS, 2); in decode_ca4p() 113 u = get_vlc2(gb, s->vlc[1].table, SHEER_VLC_BITS, 2); in decode_ca4p() 114 v = get_vlc2(gb, s->vlc[1].table, SHEER_VLC_BITS, 2); in decode_ca4p() 151 a = get_vlc2(gb, s->vlc[1].table, SHEER_VLC_BITS, 2); in decode_ca4p() [all …]
|
D | cllc.c | 45 static int read_code_table(CLLCContext *ctx, GetBitContext *gb, VLC *vlc) in read_code_table() argument 80 return ff_init_vlc_from_lengths(vlc, VLC_BITS, count, bits, 1, in read_code_table() 89 VLC *vlc, uint8_t *outbuf) in read_argb_line() argument 107 GET_VLC(code, bits, gb, vlc[0].table, VLC_BITS, VLC_DEPTH); in read_argb_line() 116 GET_VLC(code, bits, gb, vlc[1].table, VLC_BITS, VLC_DEPTH); in read_argb_line() 123 GET_VLC(code, bits, gb, vlc[2].table, VLC_BITS, VLC_DEPTH); in read_argb_line() 130 GET_VLC(code, bits, gb, vlc[3].table, VLC_BITS, VLC_DEPTH); in read_argb_line() 158 int *top_left, VLC *vlc, uint8_t *outbuf) in read_rgb24_component_line() argument 172 GET_VLC(code, bits, gb, vlc->table, VLC_BITS, VLC_DEPTH); in read_rgb24_component_line() 188 int *top_left, VLC *vlc, uint8_t *outbuf, in read_yuv_component_line() argument [all …]
|
D | dv_tablegen.h | 41 uint32_t vlc; member 65 dv_vlc_map[ff_dv_vlc_run[i]][ff_dv_vlc_level[i]].vlc = in dv_vlc_map_tableinit() 74 dv_vlc_map[i][j].vlc = dv_vlc_map[0][j].vlc | in dv_vlc_map_tableinit() 75 (dv_vlc_map[i - 1][0].vlc << in dv_vlc_map_tableinit() 84 dv_vlc_map[i][j].vlc = dv_vlc_map[0][j].vlc | in dv_vlc_map_tableinit() 85 (dv_vlc_map[i - 1][0].vlc << in dv_vlc_map_tableinit() 90 dv_vlc_map[i][((uint16_t) (-j)) & 0x1ff].vlc = dv_vlc_map[i][j].vlc | 1; in dv_vlc_map_tableinit()
|
D | tableprint_vlc.h | 54 static void write_vlc_type(const VLC *vlc, VLC_TYPE (*base_table)[2], const char *base_table_name) in WRITE_2D_FUNC() 56 printf(" .bits = %i,\n", vlc->bits); in WRITE_2D_FUNC() 58 …printf(" .table = (VLC_TYPE (*)[2])(%s + 0x%x),\n", base_table_name, (int)(vlc->table - base_ta… in WRITE_2D_FUNC() 59 printf(" .table_size = 0x%x,\n", vlc->table_size); in WRITE_2D_FUNC() 60 printf(" .table_allocated = 0x%x,\n", vlc->table_allocated); in WRITE_2D_FUNC()
|
D | dcahuff.c | 1272 #define DCA_INIT_VLC(vlc, a, b, c, d) \ in ff_dca_init_vlcs() argument 1274 vlc.table = &dca_table[vlc_offs[k]]; \ in ff_dca_init_vlcs() 1275 vlc.table_allocated = vlc_offs[k + 1] - vlc_offs[k]; \ in ff_dca_init_vlcs() 1276 init_vlc(&vlc, a, b, c, 1, 1, d, 2, 2, INIT_VLC_USE_NEW_STATIC); \ in ff_dca_init_vlcs() 1283 DCA_INIT_VLC(ff_dca_vlc_bit_allocation.vlc[i], bitalloc_12_vlc_bits[i], 12, in ff_dca_init_vlcs() 1289 DCA_INIT_VLC(ff_dca_vlc_scale_factor.vlc[i], SCALES_VLC_BITS, 129, in ff_dca_init_vlcs() 1295 DCA_INIT_VLC(ff_dca_vlc_transition_mode.vlc[i], tmode_vlc_bits[i], 4, in ff_dca_init_vlcs() 1302 DCA_INIT_VLC(ff_dca_vlc_quant_index[i].vlc[j], bitalloc_maxbits[i][j], in ff_dca_init_vlcs() 1306 #define LBR_INIT_VLC(vlc, tab, nb_bits) \ in ff_dca_init_vlcs() argument 1308 vlc.table = &dca_table[vlc_offs[k]]; \ in ff_dca_init_vlcs() [all …]
|
D | ylc.c | 40 VLC vlc[4]; member 86 static int build_vlc(AVCodecContext *avctx, VLC *vlc, const uint32_t *table) in build_vlc() argument 94 ff_free_vlc(vlc); in build_vlc() 149 return ff_init_vlc_sparse(vlc, YLC_VLC_BITS, pos, lens, 2, 2, in build_vlc() 335 ret = build_vlc(avctx, &s->vlc[i], s->table); in decode_frame() 361 int val = get_vlc2(&gb, s->vlc[0].table, YLC_VLC_BITS, 3); in decode_frame() 384 y1 = get_vlc2(&gb, s->vlc[1].table, YLC_VLC_BITS, 3); in decode_frame() 385 u = get_vlc2(&gb, s->vlc[2].table, YLC_VLC_BITS, 3); in decode_frame() 386 y2 = get_vlc2(&gb, s->vlc[1].table, YLC_VLC_BITS, 3); in decode_frame() 387 v = get_vlc2(&gb, s->vlc[3].table, YLC_VLC_BITS, 3); in decode_frame() [all …]
|
D | qdm2_tablegen.h | 114 static av_cold void build_vlc(VLC *vlc, int nb_bits, int nb_codes, in build_vlc() argument 117 vlc->table = &qdm2_table[*offset]; in build_vlc() 118 vlc->table_allocated = FF_ARRAY_ELEMS(qdm2_table) - *offset; in build_vlc() 119 ff_init_vlc_from_lengths(vlc, nb_bits, nb_codes, in build_vlc() 122 *offset += vlc->table_size; in build_vlc()
|
D | rl.c | 75 VLC vlc = { .table = table, .table_allocated = static_size }; in ff_rl_init_vlc() local 77 …init_vlc(&vlc, 9, rl->n + 1, &rl->table_vlc[0][1], 4, 2, &rl->table_vlc[0][0], 4, 2, INIT_VLC_USE_… in ff_rl_init_vlc() 90 for (i = 0; i < vlc.table_size; i++) { in ff_rl_init_vlc() 91 int code = vlc.table[i][0]; in ff_rl_init_vlc() 92 int len = vlc.table[i][1]; in ff_rl_init_vlc()
|
D | mvha.c | 44 VLC vlc; member 80 static int build_vlc(AVCodecContext *avctx, VLC *vlc) in build_vlc() argument 89 ff_free_vlc(vlc); in build_vlc() 146 return ff_init_vlc_sparse(vlc, 12, pos, lens, 2, 2, bits, 4, 4, xlat, 1, 1, 0); in build_vlc() 225 ret = build_vlc(avctx, &s->vlc); in decode_frame() 239 int v = get_vlc2(gb, s->vlc.table, s->vlc.bits, 3); in decode_frame() 305 ff_free_vlc(&s->vlc); in decode_close()
|
D | huffyuvdec.c | 153 ff_free_vlc(&s->vlc[4 + p]); in generate_joint_tables() 154 if ((ret = ff_init_vlc_sparse(&s->vlc[4 + p], VLC_BITS, i, len, 1, 1, in generate_joint_tables() 197 ff_free_vlc(&s->vlc[4]); in generate_joint_tables() 198 if ((ret = init_vlc(&s->vlc[4], VLC_BITS, i, len, 1, 1, in generate_joint_tables() 225 ff_free_vlc(&s->vlc[i]); in read_huffman_tables() 226 if ((ret = init_vlc(&s->vlc[i], VLC_BITS, s->vlc_n, s->len[i], 1, 1, in read_huffman_tables() 265 ff_free_vlc(&s->vlc[i]); in read_old_huffman_tables() 266 if ((ret = init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1, in read_old_huffman_tables() 286 ff_free_vlc(&s->vlc[i]); in decode_end() 302 memset(s->vlc, 0, 4 * sizeof(VLC)); in decode_init() [all …]
|
D | smacker.c | 200 VLC vlc[2] = { { 0 } }; in smacker_decode_header_tree() local 224 err = ff_init_vlc_from_lengths(&vlc[i], SMKTREE_BITS, h.current, in smacker_decode_header_tree() 245 ctx.v1 = &vlc[0]; in smacker_decode_header_tree() 246 ctx.v2 = &vlc[1]; in smacker_decode_header_tree() 268 ff_free_vlc(&vlc[i]); in smacker_decode_header_tree() 595 VLC vlc[4] = { { 0 } }; in smka_decode_frame() local 656 ret = ff_init_vlc_from_lengths(&vlc[i], SMKTREE_BITS, h.current, in smka_decode_frame() 679 if (vlc[idx].table) in smka_decode_frame() 680 res = get_vlc2(&gb, vlc[idx].table, SMKTREE_BITS, 3); in smka_decode_frame() 684 if (vlc[++idx].table) in smka_decode_frame() [all …]
|
D | dvenc.c | 98 uint32_t *vlc) in dv_rl2vlc() argument 102 *vlc = dv_vlc_map[run][level].vlc | sign; in dv_rl2vlc() 106 *vlc = dv_vlc_map[0][level].vlc | sign; in dv_rl2vlc() 109 *vlc = 0xfe00 | (level << 1) | sign; in dv_rl2vlc() 113 *vlc |= ((run < 16) ? dv_vlc_map[run - 1][0].vlc : in dv_rl2vlc() 136 static av_always_inline int dv_rl2vlc(int run, int l, int sign, uint32_t *vlc) in dv_rl2vlc() argument 138 *vlc = dv_vlc_map[run][l].vlc | sign; in dv_rl2vlc() 174 uint32_t vlc = bi->partial_bit_buffer; in dv_encode_ac() local 183 put_bits(pb, bits_left, vlc >> size); in dv_encode_ac() 184 vlc = av_mod_uintp2(vlc, size); in dv_encode_ac() [all …]
|
D | svq3.c | 304 unsigned vlc; in svq3_decode_block() local 309 for (; (vlc = get_interleaved_ue_golomb(gb)) != 0; index++) { in svq3_decode_block() 310 if ((int32_t)vlc < 0) in svq3_decode_block() 313 sign = (vlc & 1) ? 0 : -1; in svq3_decode_block() 314 vlc = vlc + 1 >> 1; in svq3_decode_block() 317 if (vlc < 3) { in svq3_decode_block() 319 level = vlc; in svq3_decode_block() 320 } else if (vlc < 4) { in svq3_decode_block() 324 run = vlc & 0x3; in svq3_decode_block() 325 level = (vlc + 9 >> 2) - run; in svq3_decode_block() [all …]
|
D | photocd.c | 58 VLC vlc[3]; member 187 static av_noinline int read_hufftable(AVCodecContext *avctx, VLC *vlc) in read_hufftable() argument 213 ff_free_vlc(vlc); in read_hufftable() 214 ret = ff_init_vlc_sparse(vlc, 12, count, in read_hufftable() 279 m = get_vlc2(&g, s->vlc[idx].table, s->vlc[idx].bits, 2); in decode_huff() 383 if ((ret = read_hufftable(avctx, &s->vlc[n])) < 0) in photocd_decode_frame() 395 if ((ret = read_hufftable(avctx, &s->vlc[n])) < 0) in photocd_decode_frame() 440 ff_free_vlc(&s->vlc[i]); in photocd_decode_close()
|
D | mpc8.c | 90 static av_cold void build_vlc(VLC *vlc, unsigned *buf_offset, in build_vlc() argument 98 vlc->table = &vlc_buf[*buf_offset]; in build_vlc() 99 vlc->table_allocated = FF_ARRAY_ELEMS(vlc_buf) - *buf_offset; in build_vlc() 105 ff_init_vlc_from_lengths(vlc, FFMIN(len[0], 9), num, len, 1, in build_vlc() 107 *buf_offset += vlc->table_size; in build_vlc() 337 const VLC *vlc = &quant_vlc[res - 5][cnt > mpc8_thres[res]]; in mpc8_decode_frame() local 338 c->Q[ch][off + j] = get_vlc2(gb, vlc->table, vlc->bits, 2); in mpc8_decode_frame()
|
/third_party/mesa3d/src/gallium/auxiliary/vl/ |
D | vl_mpeg12_bitstream.c | 628 vl_vlc_fillbits(&bs->vlc); in motion_vector() 629 motion_code = vl_vlc_get_vlclbf(&bs->vlc, tbl_B10, 11); in motion_vector() 633 int residual = vl_vlc_get_uimsbf(&bs->vlc, r_size) + 1; in motion_vector() 640 dmvector[t] = vl_vlc_get_vlclbf(&bs->vlc, tbl_B11, 2); in motion_vector() 662 mb->motion_vertical_field_select |= vl_vlc_get_uimsbf(&bs->vlc, 1) << s; in motion_vector_frame() 667 mb->motion_vertical_field_select |= vl_vlc_get_uimsbf(&bs->vlc, 1) << (s + 2); in motion_vector_frame() 686 mb->motion_vertical_field_select |= vl_vlc_get_uimsbf(&bs->vlc, 1) << s; in motion_vector_field() 689 mb->motion_vertical_field_select |= vl_vlc_get_uimsbf(&bs->vlc, 1) << (s + 2); in motion_vector_field() 693 mb->motion_vertical_field_select |= vl_vlc_get_uimsbf(&bs->vlc, 1) << s; in motion_vector_field() 717 vl_vlc_fillbits(&bs->vlc); in decode_dct() [all …]
|
/third_party/mesa3d/src/gallium/frontends/omx/ |
D | vid_dec_h264_common.c | 965 void vid_dec_h264_Decode(vid_dec_PrivateType *priv, struct vl_vlc *vlc, unsigned min_bits_left) in vid_dec_h264_Decode() argument 969 if (!vl_vlc_search_byte(vlc, vl_vlc_bits_left(vlc) - min_bits_left, 0x00)) in vid_dec_h264_Decode() 972 if (vl_vlc_peekbits(vlc, 24) != 0x000001) { in vid_dec_h264_Decode() 973 vl_vlc_eatbits(vlc, 8); in vid_dec_h264_Decode() 978 unsigned bytes = priv->bytes_left - (vl_vlc_bits_left(vlc) / 8); in vid_dec_h264_Decode() 985 vl_vlc_eatbits(vlc, 24); in vid_dec_h264_Decode() 988 vl_vlc_eatbits(vlc, 1); in vid_dec_h264_Decode() 990 nal_ref_idc = vl_vlc_get_uimsbf(vlc, 2); in vid_dec_h264_Decode() 998 nal_unit_type = vl_vlc_get_uimsbf(vlc, 5); in vid_dec_h264_Decode() 1005 vl_rbsp_init(&rbsp, vlc, ~0); in vid_dec_h264_Decode() [all …]
|