~ubuntu-branches/debian/experimental/libav/experimental

« back to all changes in this revision

Viewing changes to libavcodec/truemotion2.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2014-08-10 09:45:02 UTC
  • mfrom: (1.3.14)
  • mto: (1.3.16)
  • mto: This revision was merged to the branch mainline in revision 41.
  • Revision ID: package-import@ubuntu.com-20140810094502-mmdupdml8tixclg2
Tags: upstream-11~alpha1
ImportĀ upstreamĀ versionĀ 11~alpha1

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 * Duck TrueMotion2 decoder.
25
25
 */
26
26
 
 
27
#include <inttypes.h>
 
28
 
27
29
#include "avcodec.h"
 
30
#include "bswapdsp.h"
28
31
#include "bytestream.h"
29
32
#include "get_bits.h"
30
 
#include "dsputil.h"
31
33
#include "internal.h"
32
34
 
33
35
#define TM2_ESCAPE 0x80000000
61
63
    AVFrame *pic;
62
64
 
63
65
    GetBitContext gb;
64
 
    DSPContext dsp;
 
66
    BswapDSPContext bdsp;
65
67
 
66
68
    /* TM2 streams */
67
69
    int *tokens[TM2_NUM_STREAMS];
231
233
    case TM2_NEW_HEADER_MAGIC:
232
234
        return 0;
233
235
    default:
234
 
        av_log(ctx->avctx, AV_LOG_ERROR, "Not a TM2 header: 0x%08X\n", magic);
 
236
        av_log(ctx->avctx, AV_LOG_ERROR, "Not a TM2 header: 0x%08"PRIX32"\n",
 
237
               magic);
235
238
        return AVERROR_INVALIDDATA;
236
239
    }
237
240
}
855
858
        return ret;
856
859
    }
857
860
 
858
 
    l->dsp.bswap_buf((uint32_t*)swbuf, (const uint32_t*)buf, buf_size >> 2);
 
861
    l->bdsp.bswap_buf((uint32_t *) swbuf, (const uint32_t *) buf,
 
862
                      buf_size >> 2);
859
863
 
860
864
    if ((ret = tm2_read_header(l, swbuf)) < 0) {
861
865
        av_free(swbuf);
906
910
    if (!l->pic)
907
911
        return AVERROR(ENOMEM);
908
912
 
909
 
    ff_dsputil_init(&l->dsp, avctx);
 
913
    ff_bswapdsp_init(&l->bdsp);
910
914
 
911
915
    l->last  = av_malloc(4 * sizeof(*l->last)  * (w >> 2));
912
916
    l->clast = av_malloc(4 * sizeof(*l->clast) * (w >> 2));