~ubuntu-branches/ubuntu/trusty/gst-libav1.0/trusty-proposed

« back to all changes in this revision

Viewing changes to gst-libs/ext/libav/libavcodec/dxva2_vc1.c

  • Committer: Package Import Robot
  • Author(s): Sebastian Dröge
  • Date: 2013-09-24 17:07:00 UTC
  • mfrom: (1.1.17) (7.1.9 experimental)
  • Revision ID: package-import@ubuntu.com-20130924170700-4dg62s3pwl0pdakz
Tags: 1.2.0-1
* New upstream stable release:
  + debian/control:
    - Build depend on GStreamer and gst-plugins-base >= 1.2.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
    memset(pp, 0, sizeof(*pp));
43
43
    pp->wDecodedPictureIndex    =
44
44
    pp->wDeblockedPictureIndex  = ff_dxva2_get_surface_index(ctx, current_picture);
45
 
    if (s->pict_type != AV_PICTURE_TYPE_I)
 
45
    if (s->pict_type != AV_PICTURE_TYPE_I && !v->bi_type)
46
46
        pp->wForwardRefPictureIndex = ff_dxva2_get_surface_index(ctx, &s->last_picture);
47
47
    else
48
48
        pp->wForwardRefPictureIndex = 0xffff;
49
 
    if (s->pict_type == AV_PICTURE_TYPE_B)
 
49
    if (s->pict_type == AV_PICTURE_TYPE_B && !v->bi_type)
50
50
        pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(ctx, &s->next_picture);
51
51
    else
52
52
        pp->wBackwardRefPictureIndex = 0xffff;
69
69
    if (s->picture_structure & PICT_BOTTOM_FIELD)
70
70
        pp->bPicStructure      |= 0x02;
71
71
    pp->bSecondField            = v->interlace && v->fcm != ILACE_FIELD && !s->first_field;
72
 
    pp->bPicIntra               = s->pict_type == AV_PICTURE_TYPE_I;
73
 
    pp->bPicBackwardPrediction  = s->pict_type == AV_PICTURE_TYPE_B;
 
72
    pp->bPicIntra               = s->pict_type == AV_PICTURE_TYPE_I || v->bi_type;
 
73
    pp->bPicBackwardPrediction  = s->pict_type == AV_PICTURE_TYPE_B && !v->bi_type;
74
74
    pp->bBidirectionalAveragingMode = (1                                           << 7) |
75
75
                                      ((ctx->cfg->ConfigIntraResidUnsigned != 0)   << 6) |
76
76
                                      ((ctx->cfg->ConfigResidDiffAccelerator != 0) << 5) |
101
101
                                  (v->rangered       << 3) |
102
102
                                  (s->max_b_frames       );
103
103
    pp->bPicExtrapolation       = (!v->interlace || v->fcm == PROGRESSIVE) ? 1 : 2;
104
 
    pp->bPicDeblocked           = ((v->profile != PROFILE_ADVANCED && v->rangeredfrm) << 5) |
 
104
    pp->bPicDeblocked           = ((!pp->bPicBackwardPrediction && v->overlap)        << 6) |
 
105
                                  ((v->profile != PROFILE_ADVANCED && v->rangeredfrm) << 5) |
105
106
                                  (s->loop_filter                                     << 1);
106
107
    pp->bPicDeblockConfined     = (v->postprocflag             << 7) |
107
108
                                  (v->broadcast                << 6) |
166
167
    DXVA_SliceInfo *slice = &ctx_pic->si;
167
168
 
168
169
    static const uint8_t start_code[] = { 0, 0, 1, 0x0d };
169
 
    const unsigned start_code_size = avctx->codec_id == CODEC_ID_VC1 ? sizeof(start_code) : 0;
 
170
    const unsigned start_code_size = avctx->codec_id == AV_CODEC_ID_VC1 ? sizeof(start_code) : 0;
170
171
    const unsigned slice_size = slice->dwSliceBitsInBuffer / 8;
171
172
    const unsigned padding = 128 - ((start_code_size + slice_size) & 127);
172
173
    const unsigned data_size = start_code_size + slice_size + padding;
236
237
    if (ctx_pic->bitstream_size > 0)
237
238
        return -1;
238
239
 
239
 
    if (avctx->codec_id == CODEC_ID_VC1 &&
 
240
    if (avctx->codec_id == AV_CODEC_ID_VC1 &&
240
241
        size >= 4 && IS_MARKER(AV_RB32(buffer))) {
241
242
        buffer += 4;
242
243
        size   -= 4;
267
268
AVHWAccel ff_wmv3_dxva2_hwaccel = {
268
269
    .name           = "wmv3_dxva2",
269
270
    .type           = AVMEDIA_TYPE_VIDEO,
270
 
    .id             = CODEC_ID_WMV3,
271
 
    .pix_fmt        = PIX_FMT_DXVA2_VLD,
 
271
    .id             = AV_CODEC_ID_WMV3,
 
272
    .pix_fmt        = AV_PIX_FMT_DXVA2_VLD,
272
273
    .start_frame    = start_frame,
273
274
    .decode_slice   = decode_slice,
274
275
    .end_frame      = end_frame,
279
280
AVHWAccel ff_vc1_dxva2_hwaccel = {
280
281
    .name           = "vc1_dxva2",
281
282
    .type           = AVMEDIA_TYPE_VIDEO,
282
 
    .id             = CODEC_ID_VC1,
283
 
    .pix_fmt        = PIX_FMT_DXVA2_VLD,
 
283
    .id             = AV_CODEC_ID_VC1,
 
284
    .pix_fmt        = AV_PIX_FMT_DXVA2_VLD,
284
285
    .start_frame    = start_frame,
285
286
    .decode_slice   = decode_slice,
286
287
    .end_frame      = end_frame,
287
288
    .priv_data_size = sizeof(struct dxva2_picture_context),
288
289
};
289