aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-07-17 14:00:01 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-07-17 14:00:01 +0200
commit5fce29ef29e416d843a139e083ae9d3f7783132a (patch)
treebbcb461ca841e57c4fd3387de9cf21e946e13ece /libavcodec/h264.c
parentb884599f6a1c05ed8a0cbab72ac898d21456a58b (diff)
parent2db953f84671997e936f91140ffb5143c1537844 (diff)
downloadffmpeg-5fce29ef29e416d843a139e083ae9d3f7783132a.tar.gz
Merge commit '2db953f84671997e936f91140ffb5143c1537844'
* commit '2db953f84671997e936f91140ffb5143c1537844': h264: K&R formatting cosmetics Conflicts: libavcodec/h264.c libavcodec/h264_direct.c libavcodec/h264_slice.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 1d919872fe..fbab317d91 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -526,8 +526,10 @@ int ff_h264_context_init(H264Context *h)
er->mb_stride = h->mb_stride;
er->b8_stride = h->mb_width * 2 + 1;
- FF_ALLOCZ_OR_GOTO(h->avctx, er->mb_index2xy, (h->mb_num + 1) * sizeof(int),
- fail); // error ressilience code looks cleaner with this
+ // error resilience code looks cleaner with this
+ FF_ALLOCZ_OR_GOTO(h->avctx, er->mb_index2xy,
+ (h->mb_num + 1) * sizeof(int), fail);
+
for (y = 0; y < h->mb_height; y++)
for (x = 0; x < h->mb_width; x++)
er->mb_index2xy[x + y * h->mb_width] = x + y * h->mb_stride;
@@ -543,10 +545,11 @@ int ff_h264_context_init(H264Context *h)
FF_ALLOCZ_OR_GOTO(h->avctx, er->mbskip_table, mb_array_size + 2, fail);
- FF_ALLOC_OR_GOTO(h->avctx, er->er_temp_buffer, h->mb_height * h->mb_stride,
- fail);
+ FF_ALLOC_OR_GOTO(h->avctx, er->er_temp_buffer,
+ h->mb_height * h->mb_stride, fail);
- FF_ALLOCZ_OR_GOTO(h->avctx, h->dc_val_base, yc_size * sizeof(int16_t), fail);
+ FF_ALLOCZ_OR_GOTO(h->avctx, h->dc_val_base,
+ yc_size * sizeof(int16_t), fail);
er->dc_val[0] = h->dc_val_base + h->mb_width * 2 + 2;
er->dc_val[1] = h->dc_val_base + y_size + h->mb_stride + 1;
er->dc_val[2] = er->dc_val[1] + c_size;
@@ -614,7 +617,7 @@ int ff_h264_decode_extradata(H264Context *h, const uint8_t *buf, int size)
}
p += nalsize;
}
- // Now store right nal length size, that will be used to parse all other nals
+ // Store right nal length size that will be used to parse all other nals
h->nal_length_size = (buf[4] & 0x03) + 1;
} else {
h->is_avc = 0;
@@ -1049,7 +1052,7 @@ static void idr(H264Context *h)
{
int i;
ff_h264_remove_all_refs(h);
- h->prev_frame_num = 0;
+ h->prev_frame_num =
h->prev_frame_num_offset = 0;
h->prev_poc_msb = 1<<16;
h->prev_poc_lsb = 0;
@@ -1783,9 +1786,9 @@ end:
static int get_consumed_bytes(int pos, int buf_size)
{
if (pos == 0)
- pos = 1; // avoid infinite loops (i doubt that is needed but ...)
+ pos = 1; // avoid infinite loops (I doubt that is needed but...)
if (pos + 10 > buf_size)
- pos = buf_size; // oops ;)
+ pos = buf_size; // oops ;)
return pos;
}