~ubuntu-branches/ubuntu/utopic/libav/utopic-proposed

« back to all changes in this revision

Viewing changes to libavcodec/4xm.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler, Reinhard Tartler, Rico Tzschichholz
  • Date: 2014-08-30 11:02:45 UTC
  • mfrom: (1.3.47 sid)
  • Revision ID: package-import@ubuntu.com-20140830110245-io3dg7q85wfr7125
Tags: 6:11~beta1-2
[ Reinhard Tartler ]
* Make libavcodec-dev depend on libavresample-dev

[ Rico Tzschichholz ]
* Some fixes and leftovers from soname bumps

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 * 4XM codec.
25
25
 */
26
26
 
 
27
#include <inttypes.h>
 
28
 
27
29
#include "libavutil/frame.h"
28
30
#include "libavutil/imgutils.h"
29
31
#include "libavutil/intreadwrite.h"
30
32
#include "avcodec.h"
 
33
#include "blockdsp.h"
 
34
#include "bswapdsp.h"
31
35
#include "bytestream.h"
32
 
#include "dsputil.h"
33
36
#include "get_bits.h"
34
37
#include "internal.h"
35
38
 
129
132
 
130
133
typedef struct FourXContext {
131
134
    AVCodecContext *avctx;
132
 
    DSPContext dsp;
 
135
    BlockDSPContext bdsp;
 
136
    BswapDSPContext bbdsp;
133
137
    uint16_t *frame_buffer;
134
138
    uint16_t *last_frame_buffer;
135
139
    GetBitContext pre_gb;          ///< ac/dc prefix
438
442
                   bitstream_size + FF_INPUT_BUFFER_PADDING_SIZE);
439
443
    if (!f->bitstream_buffer)
440
444
        return AVERROR(ENOMEM);
441
 
    f->dsp.bswap_buf(f->bitstream_buffer, (const uint32_t*)(buf + extra),
442
 
                     bitstream_size / 4);
 
445
    f->bbdsp.bswap_buf(f->bitstream_buffer, (const uint32_t *) (buf + extra),
 
446
                       bitstream_size / 4);
443
447
    memset((uint8_t*)f->bitstream_buffer + bitstream_size,
444
448
           0, FF_INPUT_BUFFER_PADDING_SIZE);
445
449
    init_get_bits(&f->gb, f->bitstream_buffer, 8 * bitstream_size);
562
566
    int ret;
563
567
    int i;
564
568
 
565
 
    f->dsp.clear_blocks(f->block[0]);
 
569
    f->bdsp.clear_blocks(f->block[0]);
566
570
 
567
571
    for (i = 0; i < 6; i++)
568
572
        if ((ret = decode_i_block(f, f->block[i])) < 0)
761
765
                   prestream_size + FF_INPUT_BUFFER_PADDING_SIZE);
762
766
    if (!f->bitstream_buffer)
763
767
        return AVERROR(ENOMEM);
764
 
    f->dsp.bswap_buf(f->bitstream_buffer, (const uint32_t*)prestream,
765
 
                     prestream_size / 4);
 
768
    f->bbdsp.bswap_buf(f->bitstream_buffer, (const uint32_t *) prestream,
 
769
                       prestream_size / 4);
766
770
    memset((uint8_t*)f->bitstream_buffer + prestream_size,
767
771
           0, FF_INPUT_BUFFER_PADDING_SIZE);
768
772
    init_get_bits(&f->pre_gb, f->bitstream_buffer, 8 * prestream_size);
803
807
    }
804
808
 
805
809
    if (buf_size < AV_RL32(buf + 4) + 8) {
806
 
        av_log(f->avctx, AV_LOG_ERROR, "size mismatch %d %d\n",
 
810
        av_log(f->avctx, AV_LOG_ERROR, "size mismatch %d %"PRIu32"\n",
807
811
               buf_size, AV_RL32(buf + 4));
808
812
        return AVERROR_INVALIDDATA;
809
813
    }
951
955
    }
952
956
 
953
957
    f->version = AV_RL32(avctx->extradata) >> 16;
954
 
    ff_dsputil_init(&f->dsp, avctx);
 
958
    ff_blockdsp_init(&f->bdsp, avctx);
 
959
    ff_bswapdsp_init(&f->bbdsp);
955
960
    f->avctx = avctx;
956
961
    init_vlcs(f);
957
962