diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-03-17 08:49:10 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-03-17 08:51:27 +0400 |
commit | c237e88d51b9da12026734101a9ba578d04b4b15 (patch) | |
tree | 4619fc3624a92400ad92ee2b61e42f3678037a67 /libavcodec/h264_refs.c | |
parent | 4f22e39e65e9e4705845fb091a05ca4526eb835a (diff) | |
parent | 9b749c8274f6b6f35dde2cf29b99fa4f719abf87 (diff) |
Merge commit '9b749c8274f6b6f35dde2cf29b99fa4f719abf87'
* commit '9b749c8274f6b6f35dde2cf29b99fa4f719abf87':
h264: move relevant fields from Picture to H264Picture
Conflicts:
libavcodec/h264.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264_refs.c')
-rw-r--r-- | libavcodec/h264_refs.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/libavcodec/h264_refs.c b/libavcodec/h264_refs.c index e5152dc3e5..1ef27e51df 100644 --- a/libavcodec/h264_refs.c +++ b/libavcodec/h264_refs.c @@ -41,7 +41,7 @@ do {\ } while (0) -static void pic_as_field(Picture *pic, const int parity){ +static void pic_as_field(H264Picture *pic, const int parity){ int i; for (i = 0; i < 4; ++i) { if (parity == PICT_BOTTOM_FIELD) @@ -52,7 +52,7 @@ static void pic_as_field(Picture *pic, const int parity){ pic->poc= pic->field_poc[parity == PICT_BOTTOM_FIELD]; } -static int split_field_copy(Picture *dest, Picture *src, int parity, int id_add) +static int split_field_copy(H264Picture *dest, H264Picture *src, int parity, int id_add) { int match = !!(src->reference & parity); @@ -68,8 +68,8 @@ static int split_field_copy(Picture *dest, Picture *src, int parity, int id_add) return match; } -static int build_def_list(Picture *def, int def_len, - Picture **in, int len, int is_long, int sel) +static int build_def_list(H264Picture *def, int def_len, + H264Picture **in, int len, int is_long, int sel) { int i[2] = { 0 }; int index = 0; @@ -94,7 +94,7 @@ static int build_def_list(Picture *def, int def_len, return index; } -static int add_sorted(Picture **sorted, Picture **src, int len, int limit, int dir) +static int add_sorted(H264Picture **sorted, H264Picture **src, int len, int limit, int dir) { int i, best_poc; int out_i = 0; @@ -121,7 +121,7 @@ int ff_h264_fill_default_ref_list(H264Context *h) int i, len; if (h->slice_type_nos == AV_PICTURE_TYPE_B) { - Picture *sorted[32]; + H264Picture *sorted[32]; int cur_poc, list; int lens[2]; @@ -143,7 +143,7 @@ int ff_h264_fill_default_ref_list(H264Context *h) av_assert0(len <= 32); if (len < h->ref_count[list]) - memset(&h->default_ref_list[list][len], 0, sizeof(Picture) * (h->ref_count[list] - len)); + memset(&h->default_ref_list[list][len], 0, sizeof(H264Picture) * (h->ref_count[list] - len)); lens[list] = len; } @@ -152,7 +152,7 @@ int ff_h264_fill_default_ref_list(H264Context *h) h->default_ref_list[0][i].f.buf[0]->buffer == h->default_ref_list[1][i].f.buf[0]->buffer; i++); if (i == lens[0]) { - Picture tmp; + H264Picture tmp; COPY_PICTURE(&tmp, &h->default_ref_list[1][0]); COPY_PICTURE(&h->default_ref_list[1][0], &h->default_ref_list[1][1]); COPY_PICTURE(&h->default_ref_list[1][1], &tmp); @@ -167,7 +167,7 @@ int ff_h264_fill_default_ref_list(H264Context *h) av_assert0(len <= 32); if (len < h->ref_count[0]) - memset(&h->default_ref_list[0][len], 0, sizeof(Picture) * (h->ref_count[0] - len)); + memset(&h->default_ref_list[0][len], 0, sizeof(H264Picture) * (h->ref_count[0] - len)); } #ifdef TRACE for (i = 0; i < h->ref_count[0]; i++) { @@ -232,7 +232,7 @@ int ff_h264_decode_ref_pic_list_reordering(H264Context *h) unsigned int modification_of_pic_nums_idc = get_ue_golomb_31(&h->gb); unsigned int pic_id; int i; - Picture *ref = NULL; + H264Picture *ref = NULL; if (modification_of_pic_nums_idc == 3) break; @@ -306,7 +306,7 @@ int ff_h264_decode_ref_pic_list_reordering(H264Context *h) if (i < 0) { av_log(h->avctx, AV_LOG_ERROR, "reference picture missing during reorder\n"); - memset(&h->ref_list[list][index], 0, sizeof(Picture)); // FIXME + memset(&h->ref_list[list][index], 0, sizeof(H264Picture)); // FIXME } else { for (i = index; i + 1 < h->ref_count[list]; i++) { if (ref->long_ref == h->ref_list[list][i].long_ref && @@ -350,8 +350,8 @@ void ff_h264_fill_mbaff_ref_list(H264Context *h) int list, i, j; for (list = 0; list < h->list_count; list++) { for (i = 0; i < h->ref_count[list]; i++) { - Picture *frame = &h->ref_list[list][i]; - Picture *field = &h->ref_list[list][16 + 2 * i]; + H264Picture *frame = &h->ref_list[list][i]; + H264Picture *field = &h->ref_list[list][16 + 2 * i]; COPY_PICTURE(field, frame); for (j = 0; j < 3; j++) field[0].f.linesize[j] <<= 1; @@ -384,7 +384,7 @@ void ff_h264_fill_mbaff_ref_list(H264Context *h) * for display purposes) zero if one of the fields remains in * reference */ -static inline int unreference_pic(H264Context *h, Picture *pic, int refmask) +static inline int unreference_pic(H264Context *h, H264Picture *pic, int refmask) { int i; if (pic->reference &= refmask) { @@ -400,19 +400,19 @@ static inline int unreference_pic(H264Context *h, Picture *pic, int refmask) } /** - * Find a Picture in the short term reference list by frame number. + * Find a H264Picture in the short term reference list by frame number. * @param frame_num frame number to search for * @param idx the index into h->short_ref where returned picture is found * undefined if no picture found. * @return pointer to the found picture, or NULL if no pic with the provided * frame number is found */ -static Picture *find_short(H264Context *h, int frame_num, int *idx) +static H264Picture *find_short(H264Context *h, int frame_num, int *idx) { int i; for (i = 0; i < h->short_ref_count; i++) { - Picture *pic = h->short_ref[i]; + H264Picture *pic = h->short_ref[i]; if (h->avctx->debug & FF_DEBUG_MMCO) av_log(h->avctx, AV_LOG_DEBUG, "%d %d %p\n", i, pic->frame_num, pic); if (pic->frame_num == frame_num) { @@ -435,16 +435,16 @@ static void remove_short_at_index(H264Context *h, int i) h->short_ref[i] = NULL; if (--h->short_ref_count) memmove(&h->short_ref[i], &h->short_ref[i + 1], - (h->short_ref_count - i) * sizeof(Picture*)); + (h->short_ref_count - i) * sizeof(H264Picture*)); } /** * * @return the removed picture or NULL if an error occurs */ -static Picture *remove_short(H264Context *h, int frame_num, int ref_mask) +static H264Picture *remove_short(H264Context *h, int frame_num, int ref_mask) { - Picture *pic; + H264Picture *pic; int i; if (h->avctx->debug & FF_DEBUG_MMCO) @@ -464,9 +464,9 @@ static Picture *remove_short(H264Context *h, int frame_num, int ref_mask) * that list. * @return the removed picture or NULL if an error occurs */ -static Picture *remove_long(H264Context *h, int i, int ref_mask) +static H264Picture *remove_long(H264Context *h, int i, int ref_mask) { - Picture *pic; + H264Picture *pic; pic = h->long_ref[i]; if (pic) { @@ -509,7 +509,7 @@ static void print_short_term(H264Context *h) if (h->avctx->debug & FF_DEBUG_MMCO) { av_log(h->avctx, AV_LOG_DEBUG, "short term list:\n"); for (i = 0; i < h->short_ref_count; i++) { - Picture *pic = h->short_ref[i]; + H264Picture *pic = h->short_ref[i]; av_log(h->avctx, AV_LOG_DEBUG, "%d fn:%d poc:%d %p\n", i, pic->frame_num, pic->poc, pic->f.data[0]); } @@ -525,7 +525,7 @@ static void print_long_term(H264Context *h) if (h->avctx->debug & FF_DEBUG_MMCO) { av_log(h->avctx, AV_LOG_DEBUG, "long term list:\n"); for (i = 0; i < 16; i++) { - Picture *pic = h->long_ref[i]; + H264Picture *pic = h->long_ref[i]; if (pic) { av_log(h->avctx, AV_LOG_DEBUG, "%d fn:%d poc:%d %p\n", i, pic->frame_num, pic->poc, pic->f.data[0]); @@ -586,7 +586,7 @@ int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count) int i, av_uninit(j); int pps_count; int current_ref_assigned = 0, err = 0; - Picture *av_uninit(pic); + H264Picture *av_uninit(pic); if ((h->avctx->debug & FF_DEBUG_MMCO) && mmco_count == 0) av_log(h->avctx, AV_LOG_DEBUG, "no mmco here\n"); @@ -720,7 +720,7 @@ int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count) if (h->short_ref_count) memmove(&h->short_ref[1], &h->short_ref[0], - h->short_ref_count * sizeof(Picture*)); + h->short_ref_count * sizeof(H264Picture*)); h->short_ref[0] = h->cur_pic_ptr; h->short_ref_count++; |