Commit 78ac7ee9 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '5d471b73'

* commit '5d471b73':
  rtpdec: K&R formatting and spelling cosmetics
  cosmetics: Fix dropable --> droppable typo

Conflicts:
	libavcodec/h264.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 5c75708c 5d471b73
......@@ -89,8 +89,8 @@ int ff_flv_decode_picture_header(MpegEncContext *s)
s->height = height;
s->pict_type = AV_PICTURE_TYPE_I + get_bits(&s->gb, 2);
s->dropable= s->pict_type > AV_PICTURE_TYPE_P;
if (s->dropable)
s->droppable = s->pict_type > AV_PICTURE_TYPE_P;
if (s->droppable)
s->pict_type = AV_PICTURE_TYPE_P;
skip_bits1(&s->gb); /* deblocking flag */
......@@ -109,7 +109,8 @@ int ff_flv_decode_picture_header(MpegEncContext *s)
if(s->avctx->debug & FF_DEBUG_PICT_INFO){
av_log(s->avctx, AV_LOG_DEBUG, "%c esc_type:%d, qp:%d num:%d\n",
s->dropable ? 'D' : av_get_picture_type_char(s->pict_type), s->h263_flv-1, s->qscale, s->picture_number);
s->droppable ? 'D' : av_get_picture_type_char(s->pict_type),
s->h263_flv - 1, s->qscale, s->picture_number);
}
s->y_dc_scale_table=
......
......@@ -628,7 +628,9 @@ retry:
s->current_picture.f.key_frame = s->pict_type == AV_PICTURE_TYPE_I;
/* skip B-frames if we don't have reference frames */
if(s->last_picture_ptr==NULL && (s->pict_type==AV_PICTURE_TYPE_B || s->dropable)) return get_consumed_bytes(s, buf_size);
if (s->last_picture_ptr == NULL &&
(s->pict_type == AV_PICTURE_TYPE_B || s->droppable))
return get_consumed_bytes(s, buf_size);
if( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==AV_PICTURE_TYPE_B)
|| (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=AV_PICTURE_TYPE_I)
|| avctx->skip_frame >= AVDISCARD_ALL)
......
......@@ -1275,7 +1275,7 @@ static int decode_update_thread_context(AVCodecContext *dst,
if (!s->current_picture_ptr)
return 0;
if (!s->dropable) {
if (!s->droppable) {
err = ff_h264_execute_ref_pic_marking(h, h->mmco, h->mmco_index);
h->prev_poc_msb = h->poc_msb;
h->prev_poc_lsb = h->poc_lsb;
......@@ -2252,7 +2252,7 @@ static int field_end(H264Context *h, int in_setup)
int err = 0;
s->mb_y = 0;
if (!in_setup && !s->dropable)
if (!in_setup && !s->droppable)
ff_thread_report_progress(&s->current_picture_ptr->f, INT_MAX,
s->picture_structure == PICT_BOTTOM_FIELD);
......@@ -2261,7 +2261,7 @@ static int field_end(H264Context *h, int in_setup)
ff_vdpau_h264_set_reference_frames(s);
if (in_setup || !(avctx->active_thread_type & FF_THREAD_FRAME)) {
if (!s->dropable) {
if (!s->droppable) {
err = ff_h264_execute_ref_pic_marking(h, h->mmco, h->mmco_index);
h->prev_poc_msb = h->poc_msb;
h->prev_poc_lsb = h->poc_lsb;
......@@ -2376,7 +2376,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
int num_ref_idx_active_override_flag;
unsigned int slice_type, tmp, i, j;
int default_ref_list_done = 0;
int last_pic_structure, last_pic_dropable;
int last_pic_structure, last_pic_droppable;
int must_reinit;
/* FIXME: 2tap qpel isn't implemented for high bit depth. */
......@@ -2398,7 +2398,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
h0->current_slice = 0;
if (!s0->first_field) {
if (s->current_picture_ptr && !s->dropable &&
if (s->current_picture_ptr && !s->droppable &&
s->current_picture_ptr->owner2 == s) {
ff_thread_report_progress(&s->current_picture_ptr->f, INT_MAX,
s->picture_structure == PICT_BOTTOM_FIELD);
......@@ -2684,8 +2684,8 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
h->mb_mbaff = 0;
h->mb_aff_frame = 0;
last_pic_structure = s0->picture_structure;
last_pic_dropable = s0->dropable;
s->dropable = h->nal_ref_idc == 0;
last_pic_droppable = s0->droppable;
s->droppable = h->nal_ref_idc == 0;
if (h->sps.frame_mbs_only_flag) {
s->picture_structure = PICT_FRAME;
} else {
......@@ -2704,12 +2704,12 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
if (h0->current_slice != 0) {
if (last_pic_structure != s->picture_structure ||
last_pic_dropable != s->dropable) {
last_pic_droppable != s->droppable) {
av_log(h->s.avctx, AV_LOG_ERROR,
"Changing field mode (%d -> %d) between slices is not allowed\n",
last_pic_structure, s->picture_structure);
s->picture_structure = last_pic_structure;
s->dropable = last_pic_dropable;
s->droppable = last_pic_droppable;
return AVERROR_INVALIDDATA;
} else if (!s0->current_picture_ptr) {
av_log(s->avctx, AV_LOG_ERROR,
......@@ -2747,7 +2747,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
assert(s0->current_picture_ptr->f.reference != DELAYED_PIC_REF);
/* Mark old field/frame as completed */
if (!last_pic_dropable && s0->current_picture_ptr->owner2 == s0) {
if (!last_pic_droppable && s0->current_picture_ptr->owner2 == s0) {
ff_thread_report_progress(&s0->current_picture_ptr->f, INT_MAX,
last_pic_structure == PICT_BOTTOM_FIELD);
}
......@@ -2756,7 +2756,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
if (!FIELD_PICTURE || s->picture_structure == last_pic_structure) {
/* Previous field is unmatched. Don't display it, but let it
* remain for reference if marked as such. */
if (!last_pic_dropable && last_pic_structure != PICT_FRAME) {
if (!last_pic_droppable && last_pic_structure != PICT_FRAME) {
ff_thread_report_progress(&s0->current_picture_ptr->f, INT_MAX,
last_pic_structure == PICT_TOP_FIELD);
}
......@@ -2766,7 +2766,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
* different frame_nums. Consider this field first in
* pair. Throw away previous field except for reference
* purposes. */
if (!last_pic_dropable && last_pic_structure != PICT_FRAME) {
if (!last_pic_droppable && last_pic_structure != PICT_FRAME) {
ff_thread_report_progress(&s0->current_picture_ptr->f, INT_MAX,
last_pic_structure == PICT_TOP_FIELD);
}
......@@ -2780,14 +2780,14 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
"Invalid field mode combination %d/%d\n",
last_pic_structure, s->picture_structure);
s->picture_structure = last_pic_structure;
s->dropable = last_pic_dropable;
s->droppable = last_pic_droppable;
return AVERROR_INVALIDDATA;
} else if (last_pic_dropable != s->dropable) {
} else if (last_pic_droppable != s->droppable) {
av_log(s->avctx, AV_LOG_ERROR,
"Cannot combine reference and non-reference fields in the same frame\n");
av_log_ask_for_sample(s->avctx, NULL);
s->picture_structure = last_pic_structure;
s->dropable = last_pic_dropable;
s->droppable = last_pic_droppable;
return AVERROR_INVALIDDATA;
}
......@@ -3531,7 +3531,7 @@ static void decode_finish_row(H264Context *h)
ff_draw_horiz_band(s, top, height);
if (s->dropable)
if (s->droppable)
return;
ff_thread_report_progress(&s->current_picture_ptr->f, top + height - 1,
......@@ -3737,7 +3737,7 @@ static int execute_decode_slices(H264Context *h, int context_count)
hx = h->thread_context[context_count - 1];
s->mb_x = hx->s.mb_x;
s->mb_y = hx->s.mb_y;
s->dropable = hx->s.dropable;
s->droppable = hx->s.droppable;
s->picture_structure = hx->s.picture_structure;
for (i = 1; i < context_count; i++)
h->s.error_count += h->thread_context[i]->s.error_count;
......@@ -4082,7 +4082,7 @@ again:
end:
/* clean up */
if (s->current_picture_ptr && s->current_picture_ptr->owner2 == s &&
!s->dropable) {
!s->droppable) {
ff_thread_report_progress(&s->current_picture_ptr->f, INT_MAX,
s->picture_structure == PICT_BOTTOM_FIELD);
}
......
......@@ -594,7 +594,7 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst,
// B-frame info
s->max_b_frames = s1->max_b_frames;
s->low_delay = s1->low_delay;
s->dropable = s1->dropable;
s->droppable = s1->droppable;
// DivX handling (doesn't work)
s->divx_packed = s1->divx_packed;
......@@ -1348,7 +1348,7 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
}
pic->f.reference = 0;
if (!s->dropable) {
if (!s->droppable) {
if (s->codec_id == AV_CODEC_ID_H264)
pic->f.reference = s->picture_structure;
else if (s->pict_type != AV_PICTURE_TYPE_B)
......@@ -1383,7 +1383,7 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
if (s->pict_type != AV_PICTURE_TYPE_B) {
s->last_picture_ptr = s->next_picture_ptr;
if (!s->dropable)
if (!s->droppable)
s->next_picture_ptr = s->current_picture_ptr;
}
av_dlog(s->avctx, "L%p N%p C%p L%p N%p C%p type:%d drop:%d\n",
......@@ -1391,7 +1391,7 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
s->last_picture_ptr ? s->last_picture_ptr->f.data[0] : NULL,
s->next_picture_ptr ? s->next_picture_ptr->f.data[0] : NULL,
s->current_picture_ptr ? s->current_picture_ptr->f.data[0] : NULL,
s->pict_type, s->dropable);
s->pict_type, s->droppable);
if (s->codec_id != AV_CODEC_ID_H264) {
if ((s->last_picture_ptr == NULL ||
......
......@@ -346,7 +346,7 @@ typedef struct MpegEncContext {
int vbv_delay;
int last_pict_type; //FIXME removes
int last_non_b_pict_type; ///< used for mpeg4 gmc b-frames & ratecontrol
int dropable;
int droppable;
int frame_rate_index;
AVRational mpeg2_frame_rate_ext;
int last_lambda_for[5]; ///< last lambda for a specific pict type
......
......@@ -5571,7 +5571,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
s->current_picture.f.key_frame = s->pict_type == AV_PICTURE_TYPE_I;
/* skip B-frames if we don't have reference frames */
if (s->last_picture_ptr == NULL && (s->pict_type == AV_PICTURE_TYPE_B || s->dropable)) {
if (s->last_picture_ptr == NULL && (s->pict_type == AV_PICTURE_TYPE_B || s->droppable)) {
goto err;
}
if ((avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type == AV_PICTURE_TYPE_B) ||
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment