/***************************************************************************** * * XVID MPEG-4 VIDEO CODEC * - DivX 4.0 Compatibility API - * * This file is part of XviD, a free MPEG-4 video encoder/decoder * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: divx4.h,v 1.8 2003-02-17 23:15:48 edgomez Exp $ * ****************************************************************************/ #ifndef _DIVX4_H_ #define _DIVX4_H_ #ifdef __cplusplus extern "C" { #endif /***************************************************************************** * Decoder part ****************************************************************************/ /* decore commands */ #define DEC_OPT_MEMORY_REQS 0 #define DEC_OPT_INIT 1 #define DEC_OPT_RELEASE 2 #define DEC_OPT_SETPP 3 #define DEC_OPT_SETOUT 4 #define DEC_OPT_FRAME 5 #define DEC_OPT_FRAME_311 6 #define DEC_OPT_SETPP2 7 #define DEC_OPT_VERSION 8 /* return values */ #define DEC_OK 0 #define DEC_MEMORY 1 #define DEC_BAD_FORMAT 2 #define DEC_EXIT 3 /* yuv colour formats */ #define DEC_YUY2 1 #define DEC_YUV2 DEC_YUY2 #define DEC_UYVY 2 #define DEC_420 3 #define DEC_YV12 13 /* rgb colour formats */ #define DEC_RGB32 4 #define DEC_RGB24 5 #define DEC_RGB555 6 #define DEC_RGB565 7 #define DEC_RGB32_INV 8 #define DEC_RGB24_INV 9 #define DEC_RGB555_INV 10 #define DEC_RGB565_INV 11 /* return pointers to initial buffers equivalent to XVID_CSP_USER */ #define DEC_USER 12 /* output structure for DEC_USER */ typedef struct { void *y; void *u; void *v; int stride_y; int stride_uv; } DEC_PICTURE; typedef struct { unsigned long mp4_edged_ref_buffers_size; unsigned long mp4_edged_for_buffers_size; unsigned long mp4_edged_back_buffers_size; unsigned long mp4_display_buffers_size; unsigned long mp4_state_size; unsigned long mp4_tables_size; unsigned long mp4_stream_size; unsigned long mp4_reference_size; } DEC_MEM_REQS; typedef struct { void *mp4_edged_ref_buffers; void *mp4_edged_for_buffers; void *mp4_edged_back_buffers; void *mp4_display_buffers; void *mp4_state; void *mp4_tables; void *mp4_stream; void *mp4_reference; } DEC_BUFFERS; typedef struct { int x_dim; /* frame width */ int y_dim; /* frame height */ int output_format; int time_incr; DEC_BUFFERS buffers; } DEC_PARAM; typedef struct { void *bmp; /* pointer to output buffer */ void *bitstream; /* input bit stream */ long length; /* length of bitstream */ int render_flag; unsigned int stride; } DEC_FRAME; typedef struct { int intra; int *quant_store; int quant_stride; } DEC_FRAME_INFO; /* configure postprocessing */ typedef struct { int postproc_level; /* ranging from 0 to 100 */ } DEC_SET; int decore(unsigned long handle, unsigned long dec_opt, void *param1, void *param2); /***************************************************************************** * Encoder part ****************************************************************************/ /** Structure passed as an argument when creating encoder. You have to initialize at least x_dim and y_dim ( valid range: 0