On Tue, Jul 30, 2013 at 02:58:00PM +0200, Vittorio Giovara wrote:
> --- a/libavcodec/h264.c
> +++ b/libavcodec/h264.c
> @@ -4022,6 +4040,7 @@ static void loop_filter(H264Context *h, int start_x,
> int end_x)
> const int old_slice_type = h->slice_type;
> const int pixel_shift = h->pixel_shift;
> const int block_h = 16 >> h->chroma_y_shift;
> + int ret;
>
> if (h->deblocking_filter) {
> for (mb_x = start_x; mb_x < end_x; mb_x++)
This does not generate an unused variable warning?
> @@ -4142,6 +4161,7 @@ static int decode_slice(struct AVCodecContext *avctx,
> void *arg)
> {
> H264Context *h = *(void **)arg;
> int lf_x_start = h->mb_x;
> + int ret;
>
> h->mb_skip_run = -1;
>
> @@ -4162,9 +4182,9 @@ static int decode_slice(struct AVCodecContext *avctx,
> void *arg)
> ff_h264_init_cabac_states(h);
>
> for (;;) {
> - // START_TIMER
> - int ret = ff_h264_decode_mb_cabac(h);
> int eos;
> + // START_TIMER
> + ret = ff_h264_decode_mb_cabac(h);
> // STOP_TIMER("decode_mb_cabac")
>
> if (ret >= 0)
> @@ -4224,7 +4244,7 @@ static int decode_slice(struct AVCodecContext *avctx,
> void *arg)
> }
> } else {
> for (;;) {
> - int ret = ff_h264_decode_mb_cavlc(h);
> + ret = ff_h264_decode_mb_cavlc(h);
>
> if (ret >= 0)
> ff_h264_hl_decode_mb(h);
I don't really see the point.
> @@ -4452,7 +4477,8 @@ static int decode_nal_units(H264Context *h, const
> uint8_t *buf, int buf_size,
> case NAL_IDR_SLICE:
> case NAL_SLICE:
> init_get_bits(&hx->gb, ptr, bit_length);
> - if (!get_ue_golomb(&hx->gb))
> + ret = get_ue_golomb(&hx->gb);
> + if (ret == 0)
if (!ret)
The patch looks mostly OK, but I'd have to read h264.c alongside it to
be sure it does the right thing in all places.
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel