User Tools

Site Tools


ffmpeg:avcodec_decode_video

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
ffmpeg:avcodec_decode_video [2007/11/22 15:03] – created devaffmpeg:avcodec_decode_video [2007/11/22 16:49] (current) – More cosmetics... deva
Line 1: Line 1:
 =====avcodec_decode_video===== =====avcodec_decode_video=====
 +====Overview====
 Defined in ''avcodec.h''\\ Defined in ''avcodec.h''\\
  
-====Overview==== 
 Decodes a video frame from ''buf'' into ''picture''.\\ Decodes a video frame from ''buf'' into ''picture''.\\
  
 The avcodec_decode_video() function decodes a video frame from the input buffer ''buf'' of size ''buf_size''. To decode it, it makes use of the video codec which was coupled with ''avctx'' using avcodec_open(). The resulting decoded frame is stored in ''picture''.\\ The avcodec_decode_video() function decodes a video frame from the input buffer ''buf'' of size ''buf_size''. To decode it, it makes use of the video codec which was coupled with ''avctx'' using avcodec_open(). The resulting decoded frame is stored in ''picture''.\\
  
-**Warning**The input buffer must be ''FF_INPUT_BUFFER_PADDING_SIZE'' larger than the actual read bytes because some optimized bitstream readers read 32 or 64 bits at once and could read over the end.\\+**Warning:** The input buffer must be ''FF_INPUT_BUFFER_PADDING_SIZE'' larger than the actual read bytes because some optimized bitstream readers read 32 or 64 bits at once and could read over the end.\\
  
-**Warning** The end of the input buffer ''buf'' should be set to 0 to ensure that no overreading happens for damaged MPEG streams.\\+**Warning:** The end of the input buffer ''buf'' should be set to 0 to ensure that no overreading happens for damaged MPEG streams.\\
  
-**Note** You might have to align the input buffer ''buf'' and output buffer ''samples''. The alignment requirements depend on the CPU: on some CPUs it isn't necessary at all, on others it won't work at all if not aligned and on others it will work but it will have an impact on performance. In practice, the bitstream should have 4 byte alignment at minimum and all sample data should+**Note:** You might have to align the input buffer ''buf'' and output buffer ''samples''. The alignment requirements depend on the CPU: on some CPUs it isn't necessary at all, on others it won't work at all if not aligned and on others it will work but it will have an impact on performance. In practice, the bitstream should have 4 byte alignment at minimum and all sample data should
 be 16 byte aligned unless the CPU doesn't need it (AltiVec and SSE do). If the linesize is not a multiple of 16 then there's no sense in aligning the start of the buffer to 16.\\ be 16 byte aligned unless the CPU doesn't need it (AltiVec and SSE do). If the linesize is not a multiple of 16 then there's no sense in aligning the start of the buffer to 16.\\
  
Line 21: Line 21:
                          int buf_size);                          int buf_size);
 </code> </code>
 +
 ====Parameters==== ====Parameters====
 +===avctx===
 <code c>AVCodecContext *avctx</code> <code c>AVCodecContext *avctx</code>
-avctx the codec context +A [[ffmpeg:AVCodecContext]] pointer to the codec context. 
-----+ 
 +===picture===
 <code c>AVFrame *picture</code> <code c>AVFrame *picture</code>
-picture The AVFrame in which the decoded video frame will be stored. +A pointer to the [[ffmpeg:AVFrame]] in which the decoded video frame will be stored. 
-----+ 
 +===got_picture_ptr===
 <code c>int *got_picture_ptr</code> <code c>int *got_picture_ptr</code>
-got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero. +An int pointer to which zero is written if no frame could be decompressed, otherwise, it is nonzero. 
-----+ 
 +===buf===
 <code c>uint8_t *buf</code> <code c>uint8_t *buf</code>
-buf the input buffer +The input buffer. 
-----+ 
 +===buf_size===
 <code c>int buf_size</code> <code c>int buf_size</code>
-buf_size the size of the input buffer in bytes+The size of the input buffer in bytes
 ====Return value==== ====Return value====
 On error a negative value is returned, otherwise the number of bytes used or zero if no frame could be decompressed. On error a negative value is returned, otherwise the number of bytes used or zero if no frame could be decompressed.
ffmpeg/avcodec_decode_video.1195740184.txt.gz · Last modified: 2007/11/22 15:03 by deva