~ubuntu-branches/ubuntu/precise/mplayer2/precise-proposed

« back to all changes in this revision

Viewing changes to ffmpeg-mt/libavcodec/dnxhddec.c

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2011-04-21 09:21:39 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110421092139-7a21foqroxvir3wr
Tags: 2.0-54-gd33877a-1
* New upstream version
* Bug fix: "internal MP3 decoder miscompiles with gcc 4.6", thanks to
  Norbert Preining (Closes: #623279). Fixed by no longer using internal
  mp3lib copy.
* drop build host specific optimizations

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * VC3/DNxHD decoder.
3
3
 * Copyright (c) 2007 SmartJog S.A., Baptiste Coudurier <baptiste dot coudurier at smartjog dot com>
4
4
 *
5
 
 * This file is part of FFmpeg.
 
5
 * This file is part of Libav.
6
6
 *
7
 
 * FFmpeg is free software; you can redistribute it and/or
 
7
 * Libav is free software; you can redistribute it and/or
8
8
 * modify it under the terms of the GNU Lesser General Public
9
9
 * License as published by the Free Software Foundation; either
10
10
 * version 2.1 of the License, or (at your option) any later version.
11
11
 *
12
 
 * FFmpeg is distributed in the hope that it will be useful,
 
12
 * Libav is distributed in the hope that it will be useful,
13
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
15
 * Lesser General Public License for more details.
16
16
 *
17
17
 * You should have received a copy of the GNU Lesser General Public
18
 
 * License along with FFmpeg; if not, write to the Free Software
 
18
 * License along with Libav; if not, write to the Free Software
19
19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
20
 */
21
21
 
22
22
//#define TRACE
23
23
//#define DEBUG
24
24
 
25
 
#include "libavcore/imgutils.h"
 
25
#include "libavutil/imgutils.h"
26
26
#include "avcodec.h"
27
27
#include "get_bits.h"
28
28
#include "dnxhddata.h"
107
107
    ctx->height = AV_RB16(buf + 0x18);
108
108
    ctx->width  = AV_RB16(buf + 0x1a);
109
109
 
110
 
    dprintf(ctx->avctx, "width %d, heigth %d\n", ctx->width, ctx->height);
 
110
    av_dlog(ctx->avctx, "width %d, heigth %d\n", ctx->width, ctx->height);
111
111
 
112
112
    if (buf[0x21] & 0x40) {
113
113
        av_log(ctx->avctx, AV_LOG_ERROR, "10 bit per component\n");
115
115
    }
116
116
 
117
117
    ctx->cid = AV_RB32(buf + 0x28);
118
 
    dprintf(ctx->avctx, "compression id %d\n", ctx->cid);
 
118
    av_dlog(ctx->avctx, "compression id %d\n", ctx->cid);
119
119
 
120
120
    if (dnxhd_init_vlc(ctx, ctx->cid) < 0)
121
121
        return -1;
128
128
    ctx->mb_width = ctx->width>>4;
129
129
    ctx->mb_height = buf[0x16d];
130
130
 
131
 
    dprintf(ctx->avctx, "mb width %d, mb height %d\n", ctx->mb_width, ctx->mb_height);
 
131
    av_dlog(ctx->avctx, "mb width %d, mb height %d\n", ctx->mb_width, ctx->mb_height);
132
132
 
133
133
    if ((ctx->height+15)>>4 == ctx->mb_height && ctx->picture.interlaced_frame)
134
134
        ctx->height <<= 1;
141
141
 
142
142
    for (i = 0; i < ctx->mb_height; i++) {
143
143
        ctx->mb_scan_index[i] = AV_RB32(buf + 0x170 + (i<<2));
144
 
        dprintf(ctx->avctx, "mb scan index %d\n", ctx->mb_scan_index[i]);
 
144
        av_dlog(ctx->avctx, "mb scan index %d\n", ctx->mb_scan_index[i]);
145
145
        if (buf_size < ctx->mb_scan_index[i] + 0x280) {
146
146
            av_log(ctx->avctx, AV_LOG_ERROR, "invalid mb scan index\n");
147
147
            return -1;
293
293
    AVFrame *picture = data;
294
294
    int first_field = 1;
295
295
 
296
 
    dprintf(avctx, "frame size %d\n", buf_size);
 
296
    av_dlog(avctx, "frame size %d\n", buf_size);
297
297
 
298
298
 decode_coding_unit:
299
299
    if (dnxhd_decode_header(ctx, buf, buf_size, first_field) < 0)
346
346
    return 0;
347
347
}
348
348
 
349
 
AVCodec dnxhd_decoder = {
 
349
AVCodec ff_dnxhd_decoder = {
350
350
    "dnxhd",
351
351
    AVMEDIA_TYPE_VIDEO,
352
352
    CODEC_ID_DNXHD,