Lines Matching refs:nal
35 H2645RBSP *rbsp, H2645NAL *nal, int small_padding) in ff_h2645_extract_rbsp() argument
40 nal->skipped_bytes = 0; in ff_h2645_extract_rbsp()
87 nal->data = in ff_h2645_extract_rbsp()
88 nal->raw_data = src; in ff_h2645_extract_rbsp()
89 nal->size = in ff_h2645_extract_rbsp()
90 nal->raw_size = length; in ff_h2645_extract_rbsp()
95 nal->rbsp_buffer = &rbsp->rbsp_buffer[rbsp->rbsp_buffer_size]; in ff_h2645_extract_rbsp()
96 dst = nal->rbsp_buffer; in ff_h2645_extract_rbsp()
111 if (nal->skipped_bytes_pos) { in ff_h2645_extract_rbsp()
112 nal->skipped_bytes++; in ff_h2645_extract_rbsp()
113 if (nal->skipped_bytes_pos_size < nal->skipped_bytes) { in ff_h2645_extract_rbsp()
114 nal->skipped_bytes_pos_size *= 2; in ff_h2645_extract_rbsp()
115 av_assert0(nal->skipped_bytes_pos_size >= nal->skipped_bytes); in ff_h2645_extract_rbsp()
116 av_reallocp_array(&nal->skipped_bytes_pos, in ff_h2645_extract_rbsp()
117 nal->skipped_bytes_pos_size, in ff_h2645_extract_rbsp()
118 sizeof(*nal->skipped_bytes_pos)); in ff_h2645_extract_rbsp()
119 if (!nal->skipped_bytes_pos) { in ff_h2645_extract_rbsp()
120 nal->skipped_bytes_pos_size = 0; in ff_h2645_extract_rbsp()
124 if (nal->skipped_bytes_pos) in ff_h2645_extract_rbsp()
125 nal->skipped_bytes_pos[nal->skipped_bytes-1] = di - 1; in ff_h2645_extract_rbsp()
140 nal->data = dst; in ff_h2645_extract_rbsp()
141 nal->size = di; in ff_h2645_extract_rbsp()
142 nal->raw_data = src; in ff_h2645_extract_rbsp()
143 nal->raw_size = si; in ff_h2645_extract_rbsp()
263 static int get_bit_length(H2645NAL *nal, int skip_trailing_zeros) in get_bit_length() argument
265 int size = nal->size; in get_bit_length()
268 while (skip_trailing_zeros && size > 0 && nal->data[size - 1] == 0) in get_bit_length()
274 v = nal->data[size - 1]; in get_bit_length()
292 static int hevc_parse_nal_header(H2645NAL *nal, void *logctx) in hevc_parse_nal_header() argument
294 GetBitContext *gb = &nal->gb; in hevc_parse_nal_header()
299 nal->type = get_bits(gb, 6); in hevc_parse_nal_header()
301 nal->nuh_layer_id = get_bits(gb, 6); in hevc_parse_nal_header()
302 nal->temporal_id = get_bits(gb, 3) - 1; in hevc_parse_nal_header()
303 if (nal->temporal_id < 0) in hevc_parse_nal_header()
308 nal->type, hevc_nal_unit_name(nal->type), nal->nuh_layer_id, nal->temporal_id); in hevc_parse_nal_header()
313 static int h264_parse_nal_header(H2645NAL *nal, void *logctx) in h264_parse_nal_header() argument
315 GetBitContext *gb = &nal->gb; in h264_parse_nal_header()
320 nal->ref_idc = get_bits(gb, 2); in h264_parse_nal_header()
321 nal->type = get_bits(gb, 5); in h264_parse_nal_header()
325 nal->type, h264_nal_unit_name(nal->type), nal->ref_idc); in h264_parse_nal_header()
410 H2645NAL *nal; in ff_h2645_packet_split() local
469 nal = &pkt->nals[pkt->nb_nals]; in ff_h2645_packet_split()
470 nal->skipped_bytes_pos_size = FFMIN(1024, extract_length/3+1); // initial buffer size in ff_h2645_packet_split()
471 …nal->skipped_bytes_pos = av_malloc_array(nal->skipped_bytes_pos_size, sizeof(*nal->skipped_bytes_p… in ff_h2645_packet_split()
472 if (!nal->skipped_bytes_pos) in ff_h2645_packet_split()
477 nal = &pkt->nals[pkt->nb_nals]; in ff_h2645_packet_split()
479 consumed = ff_h2645_extract_rbsp(bc.buffer, extract_length, &pkt->rbsp, nal, small_padding); in ff_h2645_packet_split()
495 nal->size_bits = get_bit_length(nal, skip_trailing_zeros); in ff_h2645_packet_split()
497 if (nal->size <= 0 || nal->size_bits <= 0) in ff_h2645_packet_split()
500 ret = init_get_bits(&nal->gb, nal->data, nal->size_bits); in ff_h2645_packet_split()
505 nal->type = 0; in ff_h2645_packet_split()
508 ret = hevc_parse_nal_header(nal, logctx); in ff_h2645_packet_split()
510 ret = h264_parse_nal_header(nal, logctx); in ff_h2645_packet_split()
513 nal->type); in ff_h2645_packet_split()