Lines Matching refs:sl

134 static void h264_initialise_ref_list(H264Context *h, H264SliceContext *sl)
139 if (sl->slice_type_nos == AV_PICTURE_TYPE_B) {
154 len = build_def_list(sl->ref_list[list], FF_ARRAY_ELEMS(sl->ref_list[0]),
156 len += build_def_list(sl->ref_list[list] + len,
157 FF_ARRAY_ELEMS(sl->ref_list[0]) - len,
161 if (len < sl->ref_count[list])
162 memset(&sl->ref_list[list][len], 0, sizeof(H264Ref) * (sl->ref_count[list] - len));
168 sl->ref_list[0][i].parent->f->buf[0]->buffer ==
169 sl->ref_list[1][i].parent->f->buf[0]->buffer; i++);
171 FFSWAP(H264Ref, sl->ref_list[1][0], sl->ref_list[1][1]);
175 len = build_def_list(sl->ref_list[0], FF_ARRAY_ELEMS(sl->ref_list[0]),
177 len += build_def_list(sl->ref_list[0] + len,
178 FF_ARRAY_ELEMS(sl->ref_list[0]) - len,
182 if (len < sl->ref_count[0])
183 memset(&sl->ref_list[0][len], 0, sizeof(H264Ref) * (sl->ref_count[0] - len));
186 for (i = 0; i < sl->ref_count[0]; i++) {
188 (sl->ref_list[0][i].parent ? (sl->ref_list[0][i].parent->long_ref ? "LT" : "ST") : "??"),
189 sl->ref_list[0][i].pic_id,
190 sl->ref_list[0][i].data[0]);
192 if (sl->slice_type_nos == AV_PICTURE_TYPE_B) {
193 for (i = 0; i < sl->ref_count[1]; i++) {
195 (sl->ref_list[1][i].parent ? (sl->ref_list[1][i].parent->long_ref ? "LT" : "ST") : "??"),
196 sl->ref_list[1][i].pic_id,
197 sl->ref_list[1][i].data[0]);
202 for (j = 0; j<1+(sl->slice_type_nos == AV_PICTURE_TYPE_B); j++) {
203 for (i = 0; i < sl->ref_count[j]; i++) {
204 if (sl->ref_list[j][i].parent) {
205 if (mismatches_ref(h, sl->ref_list[j][i].parent)) {
207 memset(&sl->ref_list[j][i], 0, sizeof(sl->ref_list[j][i]));
212 for (i = 0; i < sl->list_count; i++)
213 h->default_ref[i] = sl->ref_list[i][0];
273 static void h264_fill_mbaff_ref_list(H264SliceContext *sl)
276 for (list = 0; list < sl->list_count; list++) {
277 for (i = 0; i < sl->ref_count[list]; i++) {
278 H264Ref *frame = &sl->ref_list[list][i];
279 H264Ref *field = &sl->ref_list[list][16 + 2 * i];
298 int ff_h264_build_ref_list(H264Context *h, H264SliceContext *sl)
305 h264_initialise_ref_list(h, sl);
307 for (list = 0; list < sl->list_count; list++) {
308 int pred = sl->curr_pic_num;
310 for (index = 0; index < sl->nb_ref_modifications[list]; index++) {
311 unsigned int modification_of_pic_nums_idc = sl->ref_modifications[list][index].op;
312 unsigned int val = sl->ref_modifications[list][index].val;
323 if (abs_diff_pic_num > sl->max_pic_num) {
333 pred &= sl->max_pic_num - 1;
380 memset(&sl->ref_list[list][index], 0, sizeof(sl->ref_list[0][0])); // FIXME
382 for (i = index; i + 1 < sl->ref_count[list]; i++) {
383 if (sl->ref_list[list][i].parent &&
384 ref->long_ref == sl->ref_list[list][i].parent->long_ref &&
385 ref->pic_id == sl->ref_list[list][i].pic_id)
389 sl->ref_list[list][i] = sl->ref_list[list][i - 1];
391 ref_from_h264pic(&sl->ref_list[list][index], ref);
393 pic_as_field(&sl->ref_list[list][index], pic_structure);
398 for (list = 0; list < sl->list_count; list++) {
399 for (index = 0; index < sl->ref_count[list]; index++) {
400 if ( !sl->ref_list[list][index].parent
401 || (!FIELD_PICTURE(h) && (sl->ref_list[list][index].reference&3) != 3)) {
408 sl->ref_list[list][index] = h->default_ref[list];
412 av_assert0(av_buffer_get_ref_count(sl->ref_list[list][index].parent->f->buf[0]) > 0);
417 h264_fill_mbaff_ref_list(sl);
422 int ff_h264_decode_ref_pic_list_reordering(H264SliceContext *sl, void *logctx)
426 sl->nb_ref_modifications[0] = 0;
427 sl->nb_ref_modifications[1] = 0;
429 for (list = 0; list < sl->list_count; list++) {
430 if (!get_bits1(&sl->gb)) // ref_pic_list_modification_flag_l[01]
434 unsigned int op = get_ue_golomb_31(&sl->gb);
439 if (index >= sl->ref_count[list]) {
448 sl->ref_modifications[list][index].val = get_ue_golomb_long(&sl->gb);
449 sl->ref_modifications[list][index].op = op;
450 sl->nb_ref_modifications[list]++;
833 int ff_h264_decode_ref_pic_marking(H264SliceContext *sl, GetBitContext *gb,
837 MMCO *mmco = sl->mmco;
847 sl->explicit_ref_marking = 1;
849 sl->explicit_ref_marking = get_bits1(gb);
850 if (sl->explicit_ref_marking) {
851 for (i = 0; i < FF_ARRAY_ELEMS(sl->mmco); i++) {
857 (sl->curr_pic_num - get_ue_golomb_long(gb) - 1) &
858 (sl->max_pic_num - 1);
866 !(opcode == MMCO_LONG2UNUSED && FIELD_PICTURE(sl)))) {
870 sl->nb_mmco = i;
880 sl->nb_mmco = i;
890 sl->nb_mmco = nb_mmco;