/* * Mpeg video formats-related defines and utility functions * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
typedefstruct ScratchpadContext {
uint8_t *edge_emu_buffer; ///< temporary buffer for if MVs point to out-of-frame data
uint8_t *obmc_scratchpad; union {
uint8_t *scratchpad_buf; ///< the other *_scratchpad point into this buffer
uint8_t *rd_scratchpad; ///< scratchpad for rate distortion mb decision
}; int linesize; ///< linesize that the buffers in this context have been allocated for
} ScratchpadContext;
typedefstruct BufferPoolContext { struct AVRefStructPool *mbskip_table_pool; struct AVRefStructPool *qscale_table_pool; struct AVRefStructPool *mb_type_pool; struct AVRefStructPool *motion_val_pool; struct AVRefStructPool *ref_index_pool; int alloc_mb_width; ///< mb_width used to allocate tables int alloc_mb_height; ///< mb_height used to allocate tables int alloc_mb_stride; ///< mb_stride used to allocate tables
} BufferPoolContext;
uint32_t *mb_type; ///< types and macros are defined in mpegutils.h
uint8_t *mbskip_table;
int8_t *ref_index[2];
int reference;
} MPVWorkPicture;
/** * Allocate a pool of MPVPictures.
*/ struct AVRefStructPool *ff_mpv_alloc_pic_pool(int init_progress);
/** * Allocate an MPVPicture's accessories (but not the AVFrame's buffer itself) * and set the MPVWorkPicture's fields.
*/ int ff_mpv_alloc_pic_accessories(AVCodecContext *avctx, MPVWorkPicture *pic,
ScratchpadContext *sc,
BufferPoolContext *pools, int mb_height);
/** * Check that the linesizes of an AVFrame are consistent with the requirements * of mpegvideo. * FIXME: There should be no need for this function. mpegvideo should be made * to work with changing linesizes.
*/ int ff_mpv_pic_check_linesize(void *logctx, conststruct AVFrame *f,
ptrdiff_t *linesizep, ptrdiff_t *uvlinesizep);
int ff_mpv_framesize_alloc(AVCodecContext *avctx,
ScratchpadContext *sc, int linesize);
/** * Disable allocating the ScratchpadContext's buffers in future calls * to ff_mpv_framesize_alloc().
*/ staticinlinevoid ff_mpv_framesize_disable(ScratchpadContext *sc)
{
sc->linesize = INT_MAX;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.