~noskcaj/ubuntu/saucy/libav/merge0.8.7-1

« back to all changes in this revision

Viewing changes to libavcodec/vaapi_mpeg2.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2012-01-12 22:30:00 UTC
  • mfrom: (1.2.8) (1.1.13 experimental)
  • Revision ID: package-import@ubuntu.com-20120112223000-cmfo7w78q13i2fd9
Tags: 4:0.8~beta2-1ubuntu1
* Merge from debian, remaining changes:
  - don't build against libdirac, lame, libopenjpeg, librtmp, 
    x264, and xvid  (all in universe)

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
/** Reconstruct bitstream f_code */
27
27
static inline int mpeg2_get_f_code(MpegEncContext *s)
28
28
{
29
 
    return ((s->mpeg_f_code[0][0] << 12) | (s->mpeg_f_code[0][1] << 8) |
30
 
            (s->mpeg_f_code[1][0] <<  4) |  s->mpeg_f_code[1][1]);
 
29
    return (s->mpeg_f_code[0][0] << 12) | (s->mpeg_f_code[0][1] << 8) |
 
30
           (s->mpeg_f_code[1][0] <<  4) |  s->mpeg_f_code[1][1];
31
31
}
32
32
 
33
33
/** Determine frame start: first field for field picture or frame picture */
109
109
    MpegEncContext * const s = avctx->priv_data;
110
110
    VASliceParameterBufferMPEG2 *slice_param;
111
111
    GetBitContext gb;
112
 
    uint32_t start_code, quantiser_scale_code, intra_slice_flag, macroblock_offset;
 
112
    uint32_t quantiser_scale_code, intra_slice_flag, macroblock_offset;
113
113
 
114
114
    av_dlog(avctx, "vaapi_mpeg2_decode_slice(): buffer %p, size %d\n", buffer, size);
115
115
 
116
116
    /* Determine macroblock_offset */
117
117
    init_get_bits(&gb, buffer, 8 * size);
118
 
    start_code = get_bits(&gb, 32);
119
 
    assert((start_code & 0xffffff00) == 0x00000100);
 
118
    if (get_bits_long(&gb, 32) >> 8 != 1) /* start code */
 
119
        return AVERROR_INVALIDDATA;
120
120
    quantiser_scale_code = get_bits(&gb, 5);
121
121
    intra_slice_flag = get_bits1(&gb);
122
122
    if (intra_slice_flag) {
143
143
    .type           = AVMEDIA_TYPE_VIDEO,
144
144
    .id             = CODEC_ID_MPEG2VIDEO,
145
145
    .pix_fmt        = PIX_FMT_VAAPI_VLD,
146
 
    .capabilities   = 0,
147
146
    .start_frame    = vaapi_mpeg2_start_frame,
148
147
    .end_frame      = vaapi_mpeg2_end_frame,
149
148
    .decode_slice   = vaapi_mpeg2_decode_slice,
150
 
    .priv_data_size = 0,
151
149
};