Esempio n. 1
0
void ff_proresdsp_init(ProresDSPContext *dsp)
{
#if CONFIG_PRORES_DECODER
    dsp->idct_put = prores_idct_put_c;
    dsp->idct_permutation_type = FF_NO_IDCT_PERM;

    if (HAVE_MMX) ff_proresdsp_x86_init(dsp);

    ff_init_scantable_permutation(dsp->idct_permutation,
                                  dsp->idct_permutation_type);
#endif
#if CONFIG_PRORES_ENCODER
    dsp->fdct                 = prores_fdct_c;
    dsp->dct_permutation_type = FF_NO_IDCT_PERM;
    ff_init_scantable_permutation(dsp->dct_permutation,
                                  dsp->dct_permutation_type);
#endif
}
Esempio n. 2
0
void ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx)
{
#if CONFIG_PRORES_DECODER | CONFIG_PRORES_LGPL_DECODER
    dsp->idct_put = prores_idct_put_c;
    dsp->idct_permutation_type = FF_NO_IDCT_PERM;

    if (ARCH_X86) ff_proresdsp_x86_init(dsp, avctx);

    ff_init_scantable_permutation(dsp->idct_permutation,
                                  dsp->idct_permutation_type);
#endif
#if CONFIG_PRORES_KOSTYA_ENCODER
    dsp->fdct                 = prores_fdct_c;
    dsp->dct_permutation_type = FF_NO_IDCT_PERM;
    ff_init_scantable_permutation(dsp->dct_permutation,
                                  dsp->dct_permutation_type);
#endif
}
Esempio n. 3
0
static av_cold int tgq_decode_init(AVCodecContext *avctx){
    TgqContext *s = avctx->priv_data;
    uint8_t idct_permutation[64];
    s->avctx = avctx;
    ff_init_scantable_permutation(idct_permutation, FF_NO_IDCT_PERM);
    ff_init_scantable(idct_permutation, &s->scantable, ff_zigzag_direct);
    avctx->time_base = (AVRational){1, 15};
    avctx->pix_fmt = AV_PIX_FMT_YUV420P;
    return 0;
}
Esempio n. 4
0
static av_cold int decode_init(AVCodecContext *avctx)
{
    MadContext *s = avctx->priv_data;
    s->avctx = avctx;
    avctx->pix_fmt = AV_PIX_FMT_YUV420P;
    ff_dsputil_init(&s->dsp, avctx);
    ff_init_scantable_permutation(s->dsp.idct_permutation, FF_NO_IDCT_PERM);
    ff_init_scantable(s->dsp.idct_permutation, &s->scantable, ff_zigzag_direct);
    ff_mpeg12_init_vlcs();
    return 0;
}
Esempio n. 5
0
av_cold void ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx)
{
    dsp->idct_put = prores_idct_put_c;
    dsp->idct_permutation_type = FF_IDCT_PERM_NONE;

#ifdef NDEBUG
    if (ARCH_X86)
        ff_proresdsp_init_x86(dsp, avctx);
#endif

    ff_init_scantable_permutation(dsp->idct_permutation,
                                  dsp->idct_permutation_type);
}
Esempio n. 6
0
File: eatqi.c Progetto: AVbin/libav
static av_cold int tqi_decode_init(AVCodecContext *avctx)
{
    TqiContext *t = avctx->priv_data;
    MpegEncContext *s = &t->s;
    s->avctx = avctx;
    ff_dsputil_init(&s->dsp, avctx);
    ff_init_scantable_permutation(s->dsp.idct_permutation, FF_NO_IDCT_PERM);
    ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable, ff_zigzag_direct);
    s->qscale = 1;
    avctx->time_base = (AVRational){1, 15};
    avctx->pix_fmt = AV_PIX_FMT_YUV420P;
    ff_mpeg12_init_vlcs();
    return 0;
}
Esempio n. 7
0
av_cold int ff_vp56_init_context(AVCodecContext *avctx, VP56Context *s,
                                  int flip, int has_alpha)
{
    int i;

    s->avctx = avctx;
    avctx->pix_fmt = has_alpha ? AV_PIX_FMT_YUVA420P : AV_PIX_FMT_YUV420P;

    ff_dsputil_init(&s->dsp, avctx);
    ff_h264chroma_init(&s->h264chroma, 8);
    ff_videodsp_init(&s->vdsp, 8);
    ff_vp3dsp_init(&s->vp3dsp, avctx->flags);
    ff_vp56dsp_init(&s->vp56dsp, avctx->codec->id);
    ff_init_scantable_permutation(s->dsp.idct_permutation, s->vp3dsp.idct_perm);
    ff_init_scantable(s->dsp.idct_permutation, &s->scantable,ff_zigzag_direct);

    for (i = 0; i < FF_ARRAY_ELEMS(s->frames); i++) {
        s->frames[i] = av_frame_alloc();
        if (!s->frames[i]) {
            ff_vp56_free(avctx);
            return AVERROR(ENOMEM);
        }
    }
    s->edge_emu_buffer_alloc = NULL;

    s->above_blocks = NULL;
    s->macroblocks = NULL;
    s->quantizer = -1;
    s->deblock_filtering = 1;
    s->golden_frame = 0;

    s->filter = NULL;

    s->has_alpha = has_alpha;

    s->modelp = &s->model;

    if (flip) {
        s->flip = -1;
        s->frbi = 2;
        s->srbi = 0;
    } else {
        s->flip = 1;
        s->frbi = 0;
        s->srbi = 2;
    }

    return 0;
}
Esempio n. 8
0
File: eatqi.c Progetto: AVLeo/libav
static av_cold int tqi_decode_init(AVCodecContext *avctx)
{
    TqiContext *t = avctx->priv_data;

    ff_blockdsp_init(&t->bdsp, avctx);
    ff_bswapdsp_init(&t->bsdsp);
    ff_idctdsp_init(&t->idsp, avctx);
    ff_init_scantable_permutation(t->idsp.idct_permutation, FF_IDCT_PERM_NONE);
    ff_init_scantable(t->idsp.idct_permutation, &t->intra_scantable, ff_zigzag_direct);

    avctx->framerate = (AVRational){ 15, 1 };
    avctx->pix_fmt = AV_PIX_FMT_YUV420P;
    ff_mpeg12_init_vlcs();
    return 0;
}
Esempio n. 9
0
av_cold void ff_vp56_init_context(AVCodecContext *avctx, VP56Context *s,
                                  int flip, int has_alpha)
{
    int i;

    s->avctx = avctx;
    avctx->pix_fmt = has_alpha ? AV_PIX_FMT_YUVA420P : AV_PIX_FMT_YUV420P;

    ff_dsputil_init(&s->dsp, avctx);
    ff_videodsp_init(&s->vdsp, 8);
    ff_vp3dsp_init(&s->vp3dsp, avctx->flags);
    ff_vp56dsp_init(&s->vp56dsp, avctx->codec->id);
    ff_init_scantable_permutation(s->dsp.idct_permutation, s->vp3dsp.idct_perm);
    ff_init_scantable(s->dsp.idct_permutation, &s->scantable,ff_zigzag_direct);

    for (i=0; i<4; i++) {
        s->framep[i] = &s->frames[i];
        avcodec_get_frame_defaults(&s->frames[i]);
    }
    s->framep[VP56_FRAME_UNUSED] = s->framep[VP56_FRAME_GOLDEN];
    s->framep[VP56_FRAME_UNUSED2] = s->framep[VP56_FRAME_GOLDEN2];
    s->edge_emu_buffer_alloc = NULL;

    s->above_blocks = NULL;
    s->macroblocks = NULL;
    s->quantizer = -1;
    s->deblock_filtering = 1;
    s->golden_frame = 0;

    s->filter = NULL;

    s->has_alpha = has_alpha;

    s->modelp = &s->model;

    if (flip) {
        s->flip = -1;
        s->frbi = 2;
        s->srbi = 0;
    } else {
        s->flip = 1;
        s->frbi = 0;
        s->srbi = 2;
    }
}
Esempio n. 10
0
static av_cold int decode_init(AVCodecContext *avctx)
{
    ProresContext *ctx = avctx->priv_data;
    uint8_t idct_permutation[64];

    avctx->bits_per_raw_sample = 10;

    ff_dsputil_init(&ctx->dsp, avctx);
    ff_proresdsp_init(&ctx->prodsp, avctx);

    ff_init_scantable_permutation(idct_permutation,
                                  ctx->prodsp.idct_permutation_type);

    permute(ctx->progressive_scan, ff_prores_progressive_scan, idct_permutation);
    permute(ctx->interlaced_scan, ff_prores_interlaced_scan, idct_permutation);

    return 0;
}
Esempio n. 11
0
static av_cold int decode_init(AVCodecContext *avctx)
{
    MadContext *s = avctx->priv_data;
    s->avctx = avctx;
    avctx->pix_fmt = AV_PIX_FMT_YUV420P;
    ff_blockdsp_init(&s->bdsp, avctx);
    ff_bswapdsp_init(&s->bbdsp);
    ff_idctdsp_init(&s->idsp, avctx);
    ff_init_scantable_permutation(s->idsp.idct_permutation, FF_IDCT_PERM_NONE);
    ff_init_scantable(s->idsp.idct_permutation, &s->scantable, ff_zigzag_direct);
    ff_mpeg12_init_vlcs();

    s->last_frame = av_frame_alloc();
    if (!s->last_frame)
        return AVERROR(ENOMEM);

    return 0;
}
Esempio n. 12
0
static av_cold int decode_init(AVCodecContext *avctx)
{
    ProresContext *ctx = avctx->priv_data;
    uint8_t idct_permutation[64];

    avctx->bits_per_raw_sample = 10;

    ff_blockdsp_init(&ctx->bdsp, avctx);
    ff_proresdsp_init(&ctx->prodsp, avctx);

    ff_init_scantable_permutation(idct_permutation,
                                  ctx->prodsp.idct_permutation_type);

    permute(ctx->progressive_scan, ff_prores_progressive_scan, idct_permutation);
    permute(ctx->interlaced_scan, ff_prores_interlaced_scan, idct_permutation);

    switch (avctx->codec_tag) {
    case MKTAG('a','p','c','o'):
        avctx->profile = FF_PROFILE_PRORES_PROXY;
        break;
    case MKTAG('a','p','c','s'):
        avctx->profile = FF_PROFILE_PRORES_LT;
        break;
    case MKTAG('a','p','c','n'):
        avctx->profile = FF_PROFILE_PRORES_STANDARD;
        break;
    case MKTAG('a','p','c','h'):
        avctx->profile = FF_PROFILE_PRORES_HQ;
        break;
    case MKTAG('a','p','4','h'):
        avctx->profile = FF_PROFILE_PRORES_4444;
        break;
    case MKTAG('a','p','4','x'):
        avctx->profile = FF_PROFILE_PRORES_XQ;
        break;
    default:
        avctx->profile = FF_PROFILE_UNKNOWN;
        av_log(avctx, AV_LOG_WARNING, "Unknown prores profile %d\n", avctx->codec_tag);
    }

    return 0;
}
Esempio n. 13
0
static av_cold int tqi_decode_init(AVCodecContext *avctx)
{
    TqiContext *t = avctx->priv_data;
    MpegEncContext *s = &t->s;
    s->avctx = avctx;
    ff_blockdsp_init(&s->bdsp, avctx);
    ff_bswapdsp_init(&t->bsdsp);
    ff_idctdsp_init(&s->idsp, avctx);
    ff_init_scantable_permutation(s->idsp.idct_permutation, FF_IDCT_PERM_NONE);
    ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_zigzag_direct);
    s->qscale = 1;
#ifdef IDE_COMPILE
	avctx->time_base.num = 1;
	avctx->time_base.den = 15;
#else
	avctx->time_base = (AVRational){1, 15};
#endif
	avctx->pix_fmt = AV_PIX_FMT_YUV420P;
    ff_mpeg12_init_vlcs();
    return 0;
}
Esempio n. 14
0
av_cold void ff_xvididct_init(IDCTDSPContext *c, AVCodecContext *avctx)
{
    const unsigned high_bit_depth = avctx->bits_per_raw_sample > 8;

    if (high_bit_depth || avctx->lowres ||
        !(avctx->idct_algo == FF_IDCT_AUTO ||
          avctx->idct_algo == FF_IDCT_XVID))
        return;

    if (avctx->idct_algo == FF_IDCT_XVID) {
        c->idct_put  = idct_xvid_put;
        c->idct_add  = idct_xvid_add;
        c->idct      = ff_idct_xvid;
        c->perm_type = FF_IDCT_PERM_NONE;
    }

    if (ARCH_X86)
        ff_xvididct_init_x86(c);

    ff_init_scantable_permutation(c->idct_permutation, c->perm_type);
}
Esempio n. 15
0
static av_cold int decode_init(AVCodecContext *avctx)
{
    ProresContext *ctx = avctx->priv_data;
    uint8_t idct_permutation[64];

    avctx->bits_per_raw_sample = 10;

    ff_blockdsp_init(&ctx->bdsp, avctx);
    ff_proresdsp_init(&ctx->prodsp, avctx);

    switch (avctx->codec_tag) {
    case MKTAG('a', 'p', 'c', 'h'):
        avctx->pix_fmt = PIX_FMT_YUV422P10;
        break;
    case MKTAG('a', 'p', 'c', 'n'):
        avctx->pix_fmt = PIX_FMT_YUV422P10;
        break;
    case MKTAG('a', 'p', 'c', 's'):
        avctx->pix_fmt = PIX_FMT_YUV422P10;
        break;
    case MKTAG('a', 'p', 'c', 'o'):
        avctx->pix_fmt = PIX_FMT_YUV422P10;
        break;
    case MKTAG('a', 'p', '4', 'h'):
        avctx->pix_fmt = PIX_FMT_YUV444P10;
        break;
    default:
        av_log(avctx, AV_LOG_WARNING, "Unknown ProRes FOURCC provided (%08X)\n",
               avctx->codec_tag);
    }

    ff_init_scantable_permutation(idct_permutation,
                                  ctx->prodsp.idct_permutation_type);

    permute(ctx->progressive_scan, ff_prores_progressive_scan, idct_permutation);
    permute(ctx->interlaced_scan, ff_prores_interlaced_scan, idct_permutation);

    return 0;
}