vdpau.c
Go to the documentation of this file.
1 /*
2  * Video Decode and Presentation API for UNIX (VDPAU) is used for
3  * HW decode acceleration for MPEG-1/2, MPEG-4 ASP, H.264 and VC-1.
4  *
5  * Copyright (c) 2008 NVIDIA
6  *
7  * This file is part of FFmpeg.
8  *
9  * FFmpeg is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * FFmpeg is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with FFmpeg; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22  */
23 
24 #include <limits.h>
25 #include "avcodec.h"
26 #include "h264.h"
27 #include "vc1.h"
28 
29 #undef NDEBUG
30 #include <assert.h>
31 
32 #include "vdpau.h"
33 #include "vdpau_internal.h"
34 
35 /**
36  * @addtogroup VDPAU_Decoding
37  *
38  * @{
39  */
40 
42  av_unused const uint8_t *buffer,
43  av_unused uint32_t size)
44 {
45  AVVDPAUContext *hwctx = avctx->hwaccel_context;
46 
47  hwctx->bitstream_buffers_used = 0;
48  return 0;
49 }
50 
51 #if CONFIG_H263_VDPAU_HWACCEL || CONFIG_MPEG1_VDPAU_HWACCEL || \
52  CONFIG_MPEG2_VDPAU_HWACCEL || CONFIG_MPEG4_VDPAU_HWACCEL || \
53  CONFIG_VC1_VDPAU_HWACCEL || CONFIG_WMV3_VDPAU_HWACCEL
55 {
56  AVVDPAUContext *hwctx = avctx->hwaccel_context;
57  MpegEncContext *s = avctx->priv_data;
58  VdpVideoSurface surf = ff_vdpau_get_surface_id(s->current_picture_ptr);
59 
60  hwctx->render(hwctx->decoder, surf, (void *)&hwctx->info,
62 
64  hwctx->bitstream_buffers_used = 0;
65 
66  return 0;
67 }
68 #endif
69 
71  const uint8_t *buf, uint32_t size)
72 {
73  AVVDPAUContext *hwctx = avctx->hwaccel_context;
74  VdpBitstreamBuffer *buffers = hwctx->bitstream_buffers;
75 
76  buffers = av_fast_realloc(buffers, &hwctx->bitstream_buffers_allocated,
77  (hwctx->bitstream_buffers_used + 1) * sizeof(*buffers));
78  if (!buffers)
79  return AVERROR(ENOMEM);
80 
81  hwctx->bitstream_buffers = buffers;
82  buffers += hwctx->bitstream_buffers_used++;
83 
84  buffers->struct_version = VDP_BITSTREAM_BUFFER_VERSION;
85  buffers->bitstream = buf;
86  buffers->bitstream_bytes = size;
87  return 0;
88 }
89 
90 /* Obsolete non-hwaccel VDPAU support below... */
91 
93 {
94  struct vdpau_render_state *render, *render_ref;
95  VdpReferenceFrameH264 *rf, *rf2;
96  Picture *pic;
97  int i, list, pic_frame_idx;
98 
99  render = (struct vdpau_render_state *)h->cur_pic_ptr->f.data[0];
100  assert(render);
101 
102  rf = &render->info.h264.referenceFrames[0];
103 #define H264_RF_COUNT FF_ARRAY_ELEMS(render->info.h264.referenceFrames)
104 
105  for (list = 0; list < 2; ++list) {
106  Picture **lp = list ? h->long_ref : h->short_ref;
107  int ls = list ? 16 : h->short_ref_count;
108 
109  for (i = 0; i < ls; ++i) {
110  pic = lp[i];
111  if (!pic || !pic->reference)
112  continue;
113  pic_frame_idx = pic->long_ref ? pic->pic_id : pic->frame_num;
114 
115  render_ref = (struct vdpau_render_state *)pic->f.data[0];
116  assert(render_ref);
117 
118  rf2 = &render->info.h264.referenceFrames[0];
119  while (rf2 != rf) {
120  if (
121  (rf2->surface == render_ref->surface)
122  && (rf2->is_long_term == pic->long_ref)
123  && (rf2->frame_idx == pic_frame_idx)
124  )
125  break;
126  ++rf2;
127  }
128  if (rf2 != rf) {
129  rf2->top_is_reference |= (pic->reference & PICT_TOP_FIELD) ? VDP_TRUE : VDP_FALSE;
130  rf2->bottom_is_reference |= (pic->reference & PICT_BOTTOM_FIELD) ? VDP_TRUE : VDP_FALSE;
131  continue;
132  }
133 
134  if (rf >= &render->info.h264.referenceFrames[H264_RF_COUNT])
135  continue;
136 
137  rf->surface = render_ref->surface;
138  rf->is_long_term = pic->long_ref;
139  rf->top_is_reference = (pic->reference & PICT_TOP_FIELD) ? VDP_TRUE : VDP_FALSE;
140  rf->bottom_is_reference = (pic->reference & PICT_BOTTOM_FIELD) ? VDP_TRUE : VDP_FALSE;
141  rf->field_order_cnt[0] = pic->field_poc[0];
142  rf->field_order_cnt[1] = pic->field_poc[1];
143  rf->frame_idx = pic_frame_idx;
144 
145  ++rf;
146  }
147  }
148 
149  for (; rf < &render->info.h264.referenceFrames[H264_RF_COUNT]; ++rf) {
150  rf->surface = VDP_INVALID_HANDLE;
151  rf->is_long_term = 0;
152  rf->top_is_reference = 0;
153  rf->bottom_is_reference = 0;
154  rf->field_order_cnt[0] = 0;
155  rf->field_order_cnt[1] = 0;
156  rf->frame_idx = 0;
157  }
158 }
159 
160 void ff_vdpau_add_data_chunk(uint8_t *data, const uint8_t *buf, int buf_size)
161 {
162  struct vdpau_render_state *render = (struct vdpau_render_state*)data;
163  assert(render);
164 
166  render->bitstream_buffers,
168  sizeof(*render->bitstream_buffers)*(render->bitstream_buffers_used + 1)
169  );
170 
171  render->bitstream_buffers[render->bitstream_buffers_used].struct_version = VDP_BITSTREAM_BUFFER_VERSION;
172  render->bitstream_buffers[render->bitstream_buffers_used].bitstream = buf;
173  render->bitstream_buffers[render->bitstream_buffers_used].bitstream_bytes = buf_size;
174  render->bitstream_buffers_used++;
175 }
176 
177 #if CONFIG_H264_VDPAU_DECODER
179 {
180  struct vdpau_render_state *render;
181  int i;
182 
183  render = (struct vdpau_render_state *)h->cur_pic_ptr->f.data[0];
184  assert(render);
185 
186  for (i = 0; i < 2; ++i) {
187  int foc = h->cur_pic_ptr->field_poc[i];
188  if (foc == INT_MAX)
189  foc = 0;
190  render->info.h264.field_order_cnt[i] = foc;
191  }
192 
193  render->info.h264.frame_num = h->frame_num;
194 }
195 
197 {
198  struct vdpau_render_state *render;
199 
200  render = (struct vdpau_render_state *)h->cur_pic_ptr->f.data[0];
201  assert(render);
202 
203  render->info.h264.slice_count = h->slice_num;
204  if (render->info.h264.slice_count < 1)
205  return;
206 
207  render->info.h264.is_reference = (h->cur_pic_ptr->reference & 3) ? VDP_TRUE : VDP_FALSE;
208  render->info.h264.field_pic_flag = h->picture_structure != PICT_FRAME;
209  render->info.h264.bottom_field_flag = h->picture_structure == PICT_BOTTOM_FIELD;
210  render->info.h264.num_ref_frames = h->sps.ref_frame_count;
211  render->info.h264.mb_adaptive_frame_field_flag = h->sps.mb_aff && !render->info.h264.field_pic_flag;
212  render->info.h264.constrained_intra_pred_flag = h->pps.constrained_intra_pred;
213  render->info.h264.weighted_pred_flag = h->pps.weighted_pred;
214  render->info.h264.weighted_bipred_idc = h->pps.weighted_bipred_idc;
215  render->info.h264.frame_mbs_only_flag = h->sps.frame_mbs_only_flag;
216  render->info.h264.transform_8x8_mode_flag = h->pps.transform_8x8_mode;
217  render->info.h264.chroma_qp_index_offset = h->pps.chroma_qp_index_offset[0];
218  render->info.h264.second_chroma_qp_index_offset = h->pps.chroma_qp_index_offset[1];
219  render->info.h264.pic_init_qp_minus26 = h->pps.init_qp - 26;
220  render->info.h264.num_ref_idx_l0_active_minus1 = h->pps.ref_count[0] - 1;
221  render->info.h264.num_ref_idx_l1_active_minus1 = h->pps.ref_count[1] - 1;
222  render->info.h264.log2_max_frame_num_minus4 = h->sps.log2_max_frame_num - 4;
223  render->info.h264.pic_order_cnt_type = h->sps.poc_type;
224  render->info.h264.log2_max_pic_order_cnt_lsb_minus4 = h->sps.poc_type ? 0 : h->sps.log2_max_poc_lsb - 4;
225  render->info.h264.delta_pic_order_always_zero_flag = h->sps.delta_pic_order_always_zero_flag;
226  render->info.h264.direct_8x8_inference_flag = h->sps.direct_8x8_inference_flag;
227  render->info.h264.entropy_coding_mode_flag = h->pps.cabac;
228  render->info.h264.pic_order_present_flag = h->pps.pic_order_present;
229  render->info.h264.deblocking_filter_control_present_flag = h->pps.deblocking_filter_parameters_present;
230  render->info.h264.redundant_pic_cnt_present_flag = h->pps.redundant_pic_cnt_present;
231  memcpy(render->info.h264.scaling_lists_4x4, h->pps.scaling_matrix4, sizeof(render->info.h264.scaling_lists_4x4));
232  memcpy(render->info.h264.scaling_lists_8x8[0], h->pps.scaling_matrix8[0], sizeof(render->info.h264.scaling_lists_8x8[0]));
233  memcpy(render->info.h264.scaling_lists_8x8[1], h->pps.scaling_matrix8[3], sizeof(render->info.h264.scaling_lists_8x8[0]));
234 
236  render->bitstream_buffers_used = 0;
237 }
238 #endif /* CONFIG_H264_VDPAU_DECODER */
239 
240 #if CONFIG_MPEG_VDPAU_DECODER || CONFIG_MPEG1_VDPAU_DECODER
242  int buf_size, int slice_count)
243 {
244  struct vdpau_render_state *render, *last, *next;
245  int i;
246 
247  if (!s->current_picture_ptr) return;
248 
249  render = (struct vdpau_render_state *)s->current_picture_ptr->f.data[0];
250  assert(render);
251 
252  /* fill VdpPictureInfoMPEG1Or2 struct */
253  render->info.mpeg.picture_structure = s->picture_structure;
254  render->info.mpeg.picture_coding_type = s->pict_type;
255  render->info.mpeg.intra_dc_precision = s->intra_dc_precision;
256  render->info.mpeg.frame_pred_frame_dct = s->frame_pred_frame_dct;
257  render->info.mpeg.concealment_motion_vectors = s->concealment_motion_vectors;
258  render->info.mpeg.intra_vlc_format = s->intra_vlc_format;
259  render->info.mpeg.alternate_scan = s->alternate_scan;
260  render->info.mpeg.q_scale_type = s->q_scale_type;
261  render->info.mpeg.top_field_first = s->top_field_first;
262  render->info.mpeg.full_pel_forward_vector = s->full_pel[0]; // MPEG-1 only. Set 0 for MPEG-2
263  render->info.mpeg.full_pel_backward_vector = s->full_pel[1]; // MPEG-1 only. Set 0 for MPEG-2
264  render->info.mpeg.f_code[0][0] = s->mpeg_f_code[0][0]; // For MPEG-1 fill both horiz. & vert.
265  render->info.mpeg.f_code[0][1] = s->mpeg_f_code[0][1];
266  render->info.mpeg.f_code[1][0] = s->mpeg_f_code[1][0];
267  render->info.mpeg.f_code[1][1] = s->mpeg_f_code[1][1];
268  for (i = 0; i < 64; ++i) {
269  render->info.mpeg.intra_quantizer_matrix[i] = s->intra_matrix[i];
270  render->info.mpeg.non_intra_quantizer_matrix[i] = s->inter_matrix[i];
271  }
272 
273  render->info.mpeg.forward_reference = VDP_INVALID_HANDLE;
274  render->info.mpeg.backward_reference = VDP_INVALID_HANDLE;
275 
276  switch(s->pict_type){
277  case AV_PICTURE_TYPE_B:
278  next = (struct vdpau_render_state *)s->next_picture.f.data[0];
279  assert(next);
280  render->info.mpeg.backward_reference = next->surface;
281  // no return here, going to set forward prediction
282  case AV_PICTURE_TYPE_P:
283  last = (struct vdpau_render_state *)s->last_picture.f.data[0];
284  if (!last) // FIXME: Does this test make sense?
285  last = render; // predict second field from the first
286  render->info.mpeg.forward_reference = last->surface;
287  }
288 
290 
291  render->info.mpeg.slice_count = slice_count;
292 
293  if (slice_count)
295  render->bitstream_buffers_used = 0;
296 }
297 #endif /* CONFIG_MPEG_VDPAU_DECODER || CONFIG_MPEG1_VDPAU_DECODER */
298 
299 #if CONFIG_VC1_VDPAU_DECODER
301  int buf_size)
302 {
303  VC1Context *v = s->avctx->priv_data;
304  struct vdpau_render_state *render, *last, *next;
305 
306  render = (struct vdpau_render_state *)s->current_picture.f.data[0];
307  assert(render);
308 
309  /* fill LvPictureInfoVC1 struct */
310  render->info.vc1.frame_coding_mode = v->fcm;
311  render->info.vc1.postprocflag = v->postprocflag;
312  render->info.vc1.pulldown = v->broadcast;
313  render->info.vc1.interlace = v->interlace;
314  render->info.vc1.tfcntrflag = v->tfcntrflag;
315  render->info.vc1.finterpflag = v->finterpflag;
316  render->info.vc1.psf = v->psf;
317  render->info.vc1.dquant = v->dquant;
318  render->info.vc1.panscan_flag = v->panscanflag;
319  render->info.vc1.refdist_flag = v->refdist_flag;
320  render->info.vc1.quantizer = v->quantizer_mode;
321  render->info.vc1.extended_mv = v->extended_mv;
322  render->info.vc1.extended_dmv = v->extended_dmv;
323  render->info.vc1.overlap = v->overlap;
324  render->info.vc1.vstransform = v->vstransform;
325  render->info.vc1.loopfilter = v->s.loop_filter;
326  render->info.vc1.fastuvmc = v->fastuvmc;
327  render->info.vc1.range_mapy_flag = v->range_mapy_flag;
328  render->info.vc1.range_mapy = v->range_mapy;
329  render->info.vc1.range_mapuv_flag = v->range_mapuv_flag;
330  render->info.vc1.range_mapuv = v->range_mapuv;
331  /* Specific to simple/main profile only */
332  render->info.vc1.multires = v->multires;
333  render->info.vc1.syncmarker = v->s.resync_marker;
334  render->info.vc1.rangered = v->rangered | (v->rangeredfrm << 1);
335  render->info.vc1.maxbframes = v->s.max_b_frames;
336 
337  render->info.vc1.deblockEnable = v->postprocflag & 1;
338  render->info.vc1.pquant = v->pq;
339 
340  render->info.vc1.forward_reference = VDP_INVALID_HANDLE;
341  render->info.vc1.backward_reference = VDP_INVALID_HANDLE;
342 
343  if (v->bi_type)
344  render->info.vc1.picture_type = 4;
345  else
346  render->info.vc1.picture_type = s->pict_type - 1 + s->pict_type / 3;
347 
348  switch(s->pict_type){
349  case AV_PICTURE_TYPE_B:
350  next = (struct vdpau_render_state *)s->next_picture.f.data[0];
351  assert(next);
352  render->info.vc1.backward_reference = next->surface;
353  // no break here, going to set forward prediction
354  case AV_PICTURE_TYPE_P:
355  last = (struct vdpau_render_state *)s->last_picture.f.data[0];
356  if (!last) // FIXME: Does this test make sense?
357  last = render; // predict second field from the first
358  render->info.vc1.forward_reference = last->surface;
359  }
360 
362 
363  render->info.vc1.slice_count = 1;
364 
366  render->bitstream_buffers_used = 0;
367 }
368 #endif /* (CONFIG_VC1_VDPAU_DECODER */
369 
370 #if CONFIG_MPEG4_VDPAU_DECODER
372  int buf_size)
373 {
374  struct vdpau_render_state *render, *last, *next;
375  int i;
376 
377  if (!s->current_picture_ptr) return;
378 
379  render = (struct vdpau_render_state *)s->current_picture_ptr->f.data[0];
380  assert(render);
381 
382  /* fill VdpPictureInfoMPEG4Part2 struct */
383  render->info.mpeg4.trd[0] = s->pp_time;
384  render->info.mpeg4.trb[0] = s->pb_time;
385  render->info.mpeg4.trd[1] = s->pp_field_time >> 1;
386  render->info.mpeg4.trb[1] = s->pb_field_time >> 1;
387  render->info.mpeg4.vop_time_increment_resolution = s->avctx->time_base.den;
388  render->info.mpeg4.vop_coding_type = 0;
389  render->info.mpeg4.vop_fcode_forward = s->f_code;
390  render->info.mpeg4.vop_fcode_backward = s->b_code;
391  render->info.mpeg4.resync_marker_disable = !s->resync_marker;
392  render->info.mpeg4.interlaced = !s->progressive_sequence;
393  render->info.mpeg4.quant_type = s->mpeg_quant;
394  render->info.mpeg4.quarter_sample = s->quarter_sample;
395  render->info.mpeg4.short_video_header = s->avctx->codec->id == AV_CODEC_ID_H263;
396  render->info.mpeg4.rounding_control = s->no_rounding;
397  render->info.mpeg4.alternate_vertical_scan_flag = s->alternate_scan;
398  render->info.mpeg4.top_field_first = s->top_field_first;
399  for (i = 0; i < 64; ++i) {
400  render->info.mpeg4.intra_quantizer_matrix[i] = s->intra_matrix[i];
401  render->info.mpeg4.non_intra_quantizer_matrix[i] = s->inter_matrix[i];
402  }
403  render->info.mpeg4.forward_reference = VDP_INVALID_HANDLE;
404  render->info.mpeg4.backward_reference = VDP_INVALID_HANDLE;
405 
406  switch (s->pict_type) {
407  case AV_PICTURE_TYPE_B:
408  next = (struct vdpau_render_state *)s->next_picture.f.data[0];
409  assert(next);
410  render->info.mpeg4.backward_reference = next->surface;
411  render->info.mpeg4.vop_coding_type = 2;
412  // no break here, going to set forward prediction
413  case AV_PICTURE_TYPE_P:
414  last = (struct vdpau_render_state *)s->last_picture.f.data[0];
415  assert(last);
416  render->info.mpeg4.forward_reference = last->surface;
417  }
418 
420 
422  render->bitstream_buffers_used = 0;
423 }
424 #endif /* CONFIG_MPEG4_VDPAU_DECODER */
425 
426 /* @}*/
#define PICT_BOTTOM_FIELD
Definition: mpegvideo.h:663
const struct AVCodec * codec
#define PICT_TOP_FIELD
Definition: mpegvideo.h:662
float v
const char * s
Definition: avisynth_c.h:668
The VC1 Context.
Definition: vc1.h:182
int weighted_bipred_idc
Definition: h264.h:221
int chroma_qp_index_offset[2]
Definition: h264.h:224
int extended_mv
Ext MV in P/B (not in Simple)
Definition: vc1.h:229
int broadcast
TFF/RFF present.
Definition: vc1.h:209
unsigned int ref_count[2]
num_ref_idx_l0/1_active_minus1 + 1
Definition: h264.h:219
uint8_t rangeredfrm
Frame decoding info for S/M profiles only.
Definition: vc1.h:305
int frame_mbs_only_flag
Definition: h264.h:167
H264Context.
Definition: h264.h:260
Public libavcodec VDPAU header.
int fastuvmc
Rounding of qpel vector to hpel ? (not in Simple)
Definition: vc1.h:228
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFilterBuffer structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining list
int picture_structure
Definition: h264.h:382
void ff_vdpau_h264_picture_complete(H264Context *h)
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
int long_ref
1->long term reference 0->short term reference
Definition: mpegvideo.h:165
void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int h)
Definition: mpegvideo.c:2996
uint8_t scaling_matrix4[6][16]
Definition: h264.h:229
int deblocking_filter_parameters_present
deblocking_filter_parameters_present_flag
Definition: h264.h:225
int bi_type
Definition: vc1.h:386
uint8_t
union FFVdpPictureInfo info
VDPAU picture information.
Definition: vdpau.h:92
void * hwaccel_context
Hardware accelerator context.
#define PICT_FRAME
Definition: mpegvideo.h:664
VdpBitstreamBuffer * bitstream_buffers
Table of bitstream buffers.
Definition: vdpau.h:114
int panscanflag
NUMPANSCANWIN, TOPLEFT{X,Y}, BOTRIGHT{X,Y} present.
Definition: vc1.h:212
int interlace
Progressive/interlaced (RPTFTM syntax element)
Definition: vc1.h:210
int cabac
entropy_coding_mode_flag
Definition: h264.h:215
int no_rounding
apply no rounding to motion compensation (MPEG4, msmpeg4, ...) for b-frames rounding mode is always 0...
Definition: mpegvideo.h:439
int full_pel[2]
Definition: mpegvideo.h:683
int resync_marker
could this stream contain resync markers
Definition: mpegvideo.h:591
Picture current_picture
copy of the current picture structure.
Definition: mpegvideo.h:343
int intra_dc_precision
Definition: mpegvideo.h:666
int refdist_flag
REFDIST syntax element present in II, IP, PI or PP field picture headers.
Definition: vc1.h:213
VdpDecoder decoder
VDPAU decoder handle.
Definition: vdpau.h:78
int redundant_pic_cnt_present
redundant_pic_cnt_present_flag
Definition: h264.h:227
uint16_t pp_time
time distance between the last 2 p,s,i frames
Definition: mpegvideo.h:560
int psf
Progressive Segmented Frame.
Definition: vc1.h:217
static uintptr_t ff_vdpau_get_surface_id(Picture *pic)
Extract VdpVideoSurface from a Picture.
H.264 / AVC / MPEG4 part10 codec.
int frame_num
Definition: h264.h:507
enum AVCodecID id
int mb_aff
mb_adaptive_frame_field_flag
Definition: h264.h:168
VdpBitstreamBuffer * bitstream_buffers
The user is responsible for freeing this buffer using av_freep().
Definition: vdpau.h:149
int overlap
overlapped transforms in use
Definition: vc1.h:232
This structure is used to share data between the libavcodec library and the client video application...
Definition: vdpau.h:72
int poc_type
pic_order_cnt_type
Definition: h264.h:157
void * av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
Reallocate the given block if it is not large enough, otherwise do nothing.
int constrained_intra_pred
constrained_intra_pred_flag
Definition: h264.h:226
int reference
Definition: mpegvideo.h:178
Spectrum Plot time data
PPS pps
current pps
Definition: h264.h:365
int weighted_pred
weighted_pred_flag
Definition: h264.h:220
int quarter_sample
1->qpel, 0->half pel ME/MC
Definition: mpegvideo.h:579
external API header
int postprocflag
Per-frame processing suggestion flag present.
Definition: vc1.h:208
int delta_pic_order_always_zero_flag
Definition: h264.h:159
int size
int bitstream_buffers_allocated
Allocated size of the bitstream_buffers table.
Definition: vdpau.h:99
uint8_t scaling_matrix8[6][64]
Definition: h264.h:230
int intra_vlc_format
Definition: mpegvideo.h:671
int ref_frame_count
num_ref_frames
Definition: h264.h:163
Picture * long_ref[32]
Definition: h264.h:528
int top_field_first
Definition: mpegvideo.h:668
int tfcntrflag
TFCNTR present.
Definition: vc1.h:211
Picture * current_picture_ptr
pointer to the current picture
Definition: mpegvideo.h:347
Picture.
Definition: mpegvideo.h:97
int alternate_scan
Definition: mpegvideo.h:672
SPS sps
current sps
Definition: h264.h:360
int init_qp
pic_init_qp_minus26 + 26
Definition: h264.h:222
int frame_num
h264 frame_num (raw frame_num from slice header)
Definition: mpegvideo.h:161
int direct_8x8_inference_flag
Definition: h264.h:169
uint8_t range_mapuv_flag
Definition: vc1.h:332
int mpeg_f_code[2][2]
Definition: mpegvideo.h:659
int pic_order_present
pic_order_present_flag
Definition: h264.h:216
int rangered
RANGEREDFRM (range reduction) syntax element present at frame level.
Definition: vc1.h:198
int frame_pred_frame_dct
Definition: mpegvideo.h:667
int finterpflag
INTERPFRM present.
Definition: vc1.h:234
uint16_t inter_matrix[64]
Definition: mpegvideo.h:474
AVCodecContext * avctx
Definition: h264.h:261
int concealment_motion_vectors
Definition: mpegvideo.h:669
void ff_vdpau_add_data_chunk(uint8_t *data, const uint8_t *buf, int buf_size)
Definition: vdpau.c:160
int ff_vdpau_mpeg_end_frame(AVCodecContext *avctx)
int multires
frame-level RESPIC syntax element present
Definition: vc1.h:195
main external API structure.
int bitstream_buffers_used
Definition: vdpau.h:147
uint8_t range_mapy
Definition: vc1.h:333
int extended_dmv
Additional extended dmv range at P/B frame-level.
Definition: vc1.h:214
int ff_vdpau_add_buffer(AVCodecContext *avctx, const uint8_t *buf, uint32_t size)
Definition: vdpau.c:70
void * buf
Definition: avisynth_c.h:594
int progressive_sequence
Definition: mpegvideo.h:658
Picture * short_ref[32]
Definition: h264.h:527
int bitstream_buffers_allocated
Describe size/location of the compressed video data.
Definition: vdpau.h:146
void ff_vdpau_h264_set_reference_frames(H264Context *h)
Definition: vdpau.c:92
int bitstream_buffers_used
Useful bitstream buffers in the bitstream buffers table.
Definition: vdpau.h:106
synthesis window for stochastic i
void ff_vdpau_h264_picture_start(H264Context *h)
VdpDecoderRender * render
VDPAU decoder render callback.
Definition: vdpau.h:85
VdpPictureInfoH264 h264
Definition: vdpau.h:57
int quantizer_mode
2bits, quantizer mode used for sequence, see QUANT_*
Definition: vc1.h:233
int f_code
forward MV resolution
Definition: mpegvideo.h:395
int log2_max_poc_lsb
log2_max_pic_order_cnt_lsb_minus4
Definition: h264.h:158
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFilterBuffer structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later.That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another.Buffer references ownership and permissions
int max_b_frames
max number of b-frames for encoding
Definition: mpegvideo.h:262
int pict_type
AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
Definition: mpegvideo.h:377
int vstransform
variable-size [48]x[48] transform type + info
Definition: vc1.h:231
void ff_h264_draw_horiz_band(H264Context *h, int y, int height)
Definition: h264.c:147
int ff_vdpau_common_start_frame(AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
Definition: vdpau.c:41
int field_poc[2]
h264 top/bottom POC
Definition: mpegvideo.h:159
int transform_8x8_mode
transform_8x8_mode_flag
Definition: h264.h:228
uint8_t range_mapuv
Definition: vc1.h:334
uint16_t pb_field_time
like above, just for interlaced
Definition: mpegvideo.h:563
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:87
MpegEncContext s
Definition: vc1.h:183
MpegEncContext.
Definition: mpegvideo.h:241
struct AVCodecContext * avctx
Definition: mpegvideo.h:243
uint16_t pp_field_time
Definition: mpegvideo.h:562
uint8_t pq
Definition: vc1.h:244
void ff_vdpau_mpeg_picture_complete(MpegEncContext *s, const uint8_t *buf, int buf_size, int slice_count)
VdpPictureInfoVC1 vc1
Definition: vdpau.h:59
This structure is used as a callback between the FFmpeg decoder (vd_) and presentation (vo_) module...
Definition: vdpau.h:134
enum FrameCodingMode fcm
Frame decoding info for Advanced profile.
Definition: vc1.h:311
int log2_max_frame_num
log2_max_frame_num_minus4 + 4
Definition: h264.h:156
Picture last_picture
copy of the previous picture structure.
Definition: mpegvideo.h:325
Bi-dir predicted.
Definition: avutil.h:218
the buffer and buffer reference mechanism is intended to as much as expensive copies of that data while still allowing the filters to produce correct results The data is stored in buffers represented by AVFilterBuffer structures They must not be accessed but through references stored in AVFilterBufferRef structures Several references can point to the same buffer
int den
denominator
Definition: rational.h:45
int picture_structure
Definition: mpegvideo.h:660
Picture * cur_pic_ptr
Definition: h264.h:273
int pic_id
h264 pic_num (short -> no wrap version of pic_num, pic_num & max_pic_num; long -> long_pic_num) ...
Definition: mpegvideo.h:163
void ff_vdpau_mpeg4_decode_picture(MpegEncContext *s, const uint8_t *buf, int buf_size)
Picture next_picture
copy of the next picture structure.
Definition: mpegvideo.h:331
struct AVFrame f
Definition: mpegvideo.h:98
union FFVdpPictureInfo info
picture parameter information for all supported codecs
Definition: vdpau.h:153
uint8_t range_mapy_flag
Definition: vc1.h:331
uint16_t intra_matrix[64]
matrix transmitted in the bitstream
Definition: mpegvideo.h:472
int dquant
How qscale varies with MBs, 2bits (not in Simple)
Definition: vc1.h:230
#define H264_RF_COUNT
VdpPictureInfoMPEG4Part2 mpeg4
Definition: vdpau.h:60
int b_code
backward MV resolution for B Frames (mpeg4)
Definition: mpegvideo.h:396
void ff_vdpau_vc1_decode_picture(MpegEncContext *s, const uint8_t *buf, int buf_size)
int slice_num
Definition: h264.h:372
VdpVideoSurface surface
Used as rendered surface, never changed.
Definition: vdpau.h:135
Predicted.
Definition: avutil.h:217
#define av_unused
Definition: attributes.h:114
uint16_t pb_time
time distance between the last b and p,s,i frame
Definition: mpegvideo.h:561
int short_ref_count
number of actual short term references
Definition: h264.h:543
VdpPictureInfoMPEG1Or2 mpeg
Definition: vdpau.h:58