You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1380 lines
38KB

  1. #ifndef AVCODEC_H
  2. #define AVCODEC_H
  3. /**
  4. * @file avcodec.h
  5. * external api header.
  6. */
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10. #include "common.h"
  11. #define LIBAVCODEC_VERSION_INT 0x000406
  12. #define LIBAVCODEC_VERSION "0.4.6"
  13. #define LIBAVCODEC_BUILD 4661
  14. #define LIBAVCODEC_BUILD_STR "4661"
  15. #define LIBAVCODEC_IDENT "FFmpeg" LIBAVCODEC_VERSION "b" LIBAVCODEC_BUILD_STR
  16. enum CodecID {
  17. CODEC_ID_NONE,
  18. CODEC_ID_MPEG1VIDEO,
  19. CODEC_ID_H263,
  20. CODEC_ID_RV10,
  21. CODEC_ID_MP2,
  22. CODEC_ID_MP3LAME,
  23. CODEC_ID_VORBIS,
  24. CODEC_ID_AC3,
  25. CODEC_ID_MJPEG,
  26. CODEC_ID_MJPEGB,
  27. CODEC_ID_MPEG4,
  28. CODEC_ID_RAWVIDEO,
  29. CODEC_ID_MSMPEG4V1,
  30. CODEC_ID_MSMPEG4V2,
  31. CODEC_ID_MSMPEG4V3,
  32. CODEC_ID_WMV1,
  33. CODEC_ID_WMV2,
  34. CODEC_ID_H263P,
  35. CODEC_ID_H263I,
  36. CODEC_ID_SVQ1,
  37. CODEC_ID_DVVIDEO,
  38. CODEC_ID_DVAUDIO,
  39. CODEC_ID_WMAV1,
  40. CODEC_ID_WMAV2,
  41. CODEC_ID_MACE3,
  42. CODEC_ID_MACE6,
  43. CODEC_ID_HUFFYUV,
  44. CODEC_ID_CYUV,
  45. /* various pcm "codecs" */
  46. CODEC_ID_PCM_S16LE,
  47. CODEC_ID_PCM_S16BE,
  48. CODEC_ID_PCM_U16LE,
  49. CODEC_ID_PCM_U16BE,
  50. CODEC_ID_PCM_S8,
  51. CODEC_ID_PCM_U8,
  52. CODEC_ID_PCM_MULAW,
  53. CODEC_ID_PCM_ALAW,
  54. /* various adpcm codecs */
  55. CODEC_ID_ADPCM_IMA_QT,
  56. CODEC_ID_ADPCM_IMA_WAV,
  57. CODEC_ID_ADPCM_MS,
  58. };
  59. enum CodecType {
  60. CODEC_TYPE_UNKNOWN = -1,
  61. CODEC_TYPE_VIDEO,
  62. CODEC_TYPE_AUDIO,
  63. };
  64. /**
  65. * Pixel format.
  66. */
  67. enum PixelFormat {
  68. PIX_FMT_YUV420P,
  69. PIX_FMT_YUV422,
  70. PIX_FMT_RGB24, ///< 3 bytes, R is first
  71. PIX_FMT_BGR24, ///< 3 bytes, B is first
  72. PIX_FMT_YUV422P,
  73. PIX_FMT_YUV444P,
  74. PIX_FMT_RGBA32, ///< always stored in cpu endianness
  75. PIX_FMT_YUV410P,
  76. PIX_FMT_YUV411P,
  77. PIX_FMT_RGB565, ///< always stored in cpu endianness
  78. PIX_FMT_RGB555, ///< always stored in cpu endianness, most significant bit to 1
  79. PIX_FMT_GRAY8,
  80. PIX_FMT_MONOWHITE, ///< 0 is white
  81. PIX_FMT_MONOBLACK, ///< 0 is black
  82. PIX_FMT_PAL8, ///< 8 bit with RGBA palette
  83. PIX_FMT_NB,
  84. };
  85. /* currently unused, may be used if 24/32 bits samples ever supported */
  86. enum SampleFormat {
  87. SAMPLE_FMT_S16 = 0, ///< signed 16 bits
  88. };
  89. /* in bytes */
  90. #define AVCODEC_MAX_AUDIO_FRAME_SIZE 131072
  91. /**
  92. * Required number of zero bytes at the end of the input bitstream for decoding.
  93. * to avoid overreading (and possibly segfaulting)
  94. */
  95. #define FF_INPUT_BUFFER_PADDING_SIZE 8
  96. /* motion estimation type, EPZS by default */
  97. enum Motion_Est_ID {
  98. ME_ZERO = 1,
  99. ME_FULL,
  100. ME_LOG,
  101. ME_PHODS,
  102. ME_EPZS,
  103. ME_X1
  104. };
  105. typedef struct RcOverride{
  106. int start_frame;
  107. int end_frame;
  108. int qscale; // if this is 0 then quality_factor will be used instead
  109. float quality_factor;
  110. } RcOverride;
  111. /* only for ME compatiblity with old apps */
  112. extern int motion_estimation_method;
  113. /* ME algos sorted by quality */
  114. static const int Motion_Est_QTab[] = { ME_ZERO, ME_PHODS, ME_LOG,
  115. ME_X1, ME_EPZS, ME_FULL };
  116. #define FF_MAX_B_FRAMES 8
  117. /* encoding support
  118. these flags can be passed in AVCodecContext.flags before initing
  119. Note: note not everything is supported yet
  120. */
  121. #define CODEC_FLAG_HQ 0x0001 ///< brute force MB-type decission mode (slow)
  122. #define CODEC_FLAG_QSCALE 0x0002 ///< use fixed qscale
  123. #define CODEC_FLAG_4MV 0x0004 ///< 4 MV per MB allowed
  124. #define CODEC_FLAG_QPEL 0x0010 ///< use qpel MC
  125. #define CODEC_FLAG_GMC 0x0020 ///< use GMC
  126. #define CODEC_FLAG_PART 0x0080 ///< use data partitioning
  127. /* parent program gurantees that the input for b-frame containing streams is not written to
  128. for at least s->max_b_frames+1 frames, if this is not set than the input will be copied */
  129. #define CODEC_FLAG_INPUT_PRESERVED 0x0100
  130. #define CODEC_FLAG_PASS1 0x0200 ///< use internal 2pass ratecontrol in first pass mode
  131. #define CODEC_FLAG_PASS2 0x0400 ///< use internal 2pass ratecontrol in second pass mode
  132. #define CODEC_FLAG_EXTERN_HUFF 0x1000 ///< use external huffman table (for mjpeg)
  133. #define CODEC_FLAG_GRAY 0x2000 ///< only decode/encode grayscale
  134. #define CODEC_FLAG_EMU_EDGE 0x4000///< dont draw edges
  135. #define CODEC_FLAG_PSNR 0x8000 ///< error[?] variables will be set during encoding
  136. #define CODEC_FLAG_TRUNCATED 0x00010000 /** input bitstream might be truncated at a random location instead
  137. of only at frame boundaries */
  138. #define CODEC_FLAG_NORMALIZE_AQP 0x00020000 ///< normalize adaptive quantization
  139. #define CODEC_FLAG_INTERLACED_DCT 0x00040000 ///< use interlaced dct
  140. #define CODEC_FLAG_LOW_DELAY 0x00080000 ///< force low delay / will fail on b frames
  141. #define CODEC_FLAG_ALT_SCAN 0x00100000 ///< use alternate scan
  142. #define CODEC_FLAG_TRELLIS_QUANT 0x00200000 ///< use trellis quantization
  143. #define CODEC_FLAG_GLOBAL_HEADER 0x00400000 ///< place global headers in extradata instead of every keyframe
  144. #define CODEC_FLAG_BITEXACT 0x00800000 ///< use only bitexact stuff (except (i)dct)
  145. /* Fx : Flag for h263+ extra options */
  146. #define CODEC_FLAG_H263P_AIC 0x01000000 ///< Advanced intra coding
  147. #define CODEC_FLAG_H263P_UMV 0x02000000 ///< Unlimited motion vector
  148. /* For advanced prediction mode, we reuse the 4MV flag */
  149. /* Unsupported options :
  150. * Syntax Arithmetic coding (SAC)
  151. * Deblocking filter internal loop
  152. * Slice structured
  153. * Reference Picture Selection
  154. * Independant Segment Decoding
  155. * Alternative Inter * VLC
  156. * Modified Quantization */
  157. /* /Fx */
  158. /* codec capabilities */
  159. #define CODEC_CAP_DRAW_HORIZ_BAND 0x0001 ///< decoder can use draw_horiz_band callback
  160. #define CODEC_CAP_DR1 0x0002 ///< direct rendering method 1
  161. /* if 'parse_only' field is true, then avcodec_parse_frame() can be
  162. used */
  163. #define CODEC_CAP_PARSE_ONLY 0x0004
  164. #define CODEC_CAP_TRUNCATED 0x0008
  165. #define FF_COMMON_FRAME \
  166. uint8_t *data[4];\
  167. int linesize[4];\
  168. /**\
  169. * pointer to the first allocated byte of the picture. can be used in get_buffer/release_buffer\
  170. * this isnt used by lavc unless the default get/release_buffer() is used\
  171. * - encoding: \
  172. * - decoding: \
  173. */\
  174. uint8_t *base[4];\
  175. /**\
  176. * 1 -> keyframe, 0-> not\
  177. * - encoding: set by lavc\
  178. * - decoding: set by lavc\
  179. */\
  180. int key_frame;\
  181. \
  182. /**\
  183. * picture type of the frame, see ?_TYPE below\
  184. * - encoding: set by lavc for coded_picture (and set by user for input)\
  185. * - decoding: set by lavc\
  186. */\
  187. int pict_type;\
  188. \
  189. /**\
  190. * presentation timestamp in micro seconds (time when frame should be shown to user)\
  191. * if 0 then the frame_rate will be used as reference\
  192. * - encoding: MUST be set by user\
  193. * - decoding: set by lavc\
  194. */\
  195. long long int pts;\
  196. \
  197. /**\
  198. * picture number in bitstream order.\
  199. * - encoding: set by\
  200. * - decoding: set by lavc\
  201. */\
  202. int coded_picture_number;\
  203. /**\
  204. * picture number in display order.\
  205. * - encoding: set by\
  206. * - decoding: set by lavc\
  207. */\
  208. int display_picture_number;\
  209. \
  210. /**\
  211. * quality (between 1 (good) and 31 (bad)) \
  212. * - encoding: set by lavc for coded_picture (and set by user for input)\
  213. * - decoding: set by lavc\
  214. */\
  215. float quality; \
  216. \
  217. /**\
  218. * buffer age (1->was last buffer and dint change, 2->..., ...).\
  219. * set to something large if the buffer has not been used yet \
  220. * - encoding: unused\
  221. * - decoding: MUST be set by get_buffer()\
  222. */\
  223. int age;\
  224. \
  225. /**\
  226. * is this picture used as reference\
  227. * - encoding: unused\
  228. * - decoding: set by lavc (before get_buffer() call))\
  229. */\
  230. int reference;\
  231. \
  232. /**\
  233. * QP table\
  234. * - encoding: unused\
  235. * - decoding: set by lavc\
  236. */\
  237. int8_t *qscale_table;\
  238. /**\
  239. * QP store stride\
  240. * - encoding: unused\
  241. * - decoding: set by lavc\
  242. */\
  243. int qstride;\
  244. \
  245. /**\
  246. * mbskip_table[mb]>=1 if MB didnt change\
  247. * stride= mb_width = (width+15)>>4\
  248. * - encoding: unused\
  249. * - decoding: set by lavc\
  250. */\
  251. uint8_t *mbskip_table;\
  252. \
  253. /**\
  254. * for some private data of the user\
  255. * - encoding: unused\
  256. * - decoding: set by user\
  257. */\
  258. void *opaque;\
  259. \
  260. /**\
  261. * error\
  262. * - encoding: set by lavc if flags&CODEC_FLAG_PSNR\
  263. * - decoding: unused\
  264. */\
  265. uint64_t error[4];\
  266. \
  267. /**\
  268. * type of the buffer (to keep track of who has to dealloc data[*])\
  269. * - encoding: set by the one who allocs it\
  270. * - decoding: set by the one who allocs it\
  271. * Note: user allocated (direct rendering) & internal buffers can not coexist currently\
  272. */\
  273. int type;\
  274. \
  275. /**\
  276. * when decoding, this signal how much the picture must be delayed.\
  277. * extra_delay = repeat_pict / (2*fps)\
  278. * - encoding: unused\
  279. * - decoding: set by lavc\
  280. */\
  281. int repeat_pict;
  282. #define FF_BUFFER_TYPE_INTERNAL 1
  283. #define FF_BUFFER_TYPE_USER 2 // Direct rendering buffers
  284. #define FF_BUFFER_TYPE_SHARED 4 // input frame for encoding(wont be dealloced)
  285. #define FF_I_TYPE 1 // Intra
  286. #define FF_P_TYPE 2 // Predicted
  287. #define FF_B_TYPE 3 // Bi-dir predicted
  288. #define FF_S_TYPE 4 // S(GMC)-VOP MPEG4
  289. typedef struct AVFrame {
  290. FF_COMMON_FRAME
  291. } AVFrame;
  292. #define DEFAULT_FRAME_RATE_BASE 1001000
  293. /**
  294. * main external api structure.
  295. */
  296. typedef struct AVCodecContext {
  297. /**
  298. * the average bitrate.
  299. * - encoding: set by user. unused for constant quantizer encoding
  300. * - decoding: set by lavc. 0 or some bitrate if this info is available in the stream
  301. */
  302. int bit_rate;
  303. /**
  304. * number of bits the bitstream is allowed to diverge from the reference.
  305. * the reference can be CBR (for CBR pass1) or VBR (for pass2)
  306. * - encoding: set by user. unused for constant quantizer encoding
  307. * - decoding: unused
  308. */
  309. int bit_rate_tolerance;
  310. /**
  311. * CODEC_FLAG_*.
  312. * - encoding: set by user.
  313. * - decoding: set by user.
  314. */
  315. int flags;
  316. /**
  317. * some codecs needs additionnal format info. It is stored here
  318. * - encoding: set by user.
  319. * - decoding: set by lavc. (FIXME is this ok?)
  320. */
  321. int sub_id;
  322. /**
  323. * motion estimation algorithm used for video coding.
  324. * - encoding: MUST be set by user.
  325. * - decoding: unused
  326. */
  327. int me_method;
  328. /**
  329. * some codecs need / can use extra-data like huffman tables.
  330. * mjpeg: huffman tables
  331. * rv10: additional flags
  332. * mpeg4: global headers (they can be in the bitstream or here)
  333. * - encoding: set/allocated/freed by lavc.
  334. * - decoding: set/allocated/freed by user.
  335. */
  336. void *extradata;
  337. int extradata_size;
  338. /* video only */
  339. /**
  340. * frames per sec multiplied by frame_rate_base.
  341. * for variable fps this is the precission, so if the timestamps
  342. * can be specified in msec precssion then this is 1000*frame_rate_base
  343. * - encoding: MUST be set by user
  344. * - decoding: set by lavc. 0 or the frame_rate if available
  345. */
  346. int frame_rate;
  347. /**
  348. * frame_rate_base.
  349. * for variable fps this is 1
  350. * - encoding: set by user.
  351. * - decoding: set by lavc.
  352. */
  353. int frame_rate_base;
  354. /**
  355. * width / height.
  356. * - encoding: MUST be set by user.
  357. * - decoding: set by user, some codecs might override / change it during playback
  358. */
  359. int width, height;
  360. #define FF_ASPECT_SQUARE 1
  361. #define FF_ASPECT_4_3_625 2
  362. #define FF_ASPECT_4_3_525 3
  363. #define FF_ASPECT_16_9_625 4
  364. #define FF_ASPECT_16_9_525 5
  365. #define FF_ASPECT_EXTENDED 15
  366. /**
  367. * the number of pictures in a group of pitures, or 0 for intra_only.
  368. * - encoding: set by user.
  369. * - decoding: unused
  370. */
  371. int gop_size;
  372. /**
  373. * pixel format, see PIX_FMT_xxx.
  374. * - encoding: unused
  375. * - decoding: set by lavc.
  376. */
  377. enum PixelFormat pix_fmt;
  378. /**
  379. * Frame rate emulation. If not zero lower layer (i.e. format handler)
  380. * has to read frames at native frame rate.
  381. * - encoding: set by user.
  382. * - decoding: unused.
  383. */
  384. int rate_emu;
  385. /**
  386. * if non NULL, 'draw_horiz_band' is called by the libavcodec
  387. * decoder to draw an horizontal band. It improve cache usage. Not
  388. * all codecs can do that. You must check the codec capabilities
  389. * before
  390. * - encoding: unused
  391. * - decoding: set by user.
  392. */
  393. void (*draw_horiz_band)(struct AVCodecContext *s,
  394. uint8_t **src_ptr, int linesize,
  395. int y, int width, int height);
  396. /* audio only */
  397. int sample_rate; ///< samples per sec
  398. int channels;
  399. int sample_fmt; ///< sample format, currenly unused
  400. /* the following data should not be initialized */
  401. int frame_size; ///< in samples, initialized when calling 'init'
  402. int frame_number; ///< audio or video frame number
  403. int real_pict_num; ///< returns the real picture number of previous encoded frame
  404. /**
  405. * number of frames the decoded output will be delayed relative to
  406. * the encoded input.
  407. * - encoding: set by lavc.
  408. * - decoding: unused
  409. */
  410. int delay;
  411. /* - encoding parameters */
  412. float qcompress; ///< amount of qscale change between easy & hard scenes (0.0-1.0)
  413. float qblur; ///< amount of qscale smoothing over time (0.0-1.0)
  414. /**
  415. * minimum quantizer.
  416. * - encoding: set by user.
  417. * - decoding: unused
  418. */
  419. int qmin;
  420. /**
  421. * maximum quantizer.
  422. * - encoding: set by user.
  423. * - decoding: unused
  424. */
  425. int qmax;
  426. /**
  427. * maximum quantizer difference etween frames.
  428. * - encoding: set by user.
  429. * - decoding: unused
  430. */
  431. int max_qdiff;
  432. /**
  433. * maximum number of b frames between non b frames.
  434. * note: the output will be delayed by max_b_frames+1 relative to the input
  435. * - encoding: set by user.
  436. * - decoding: unused
  437. */
  438. int max_b_frames;
  439. /**
  440. * qscale factor between ip and b frames.
  441. * - encoding: set by user.
  442. * - decoding: unused
  443. */
  444. float b_quant_factor;
  445. /** obsolete FIXME remove */
  446. int rc_strategy;
  447. int b_frame_strategy;
  448. /**
  449. * hurry up amount.
  450. * - encoding: unused
  451. * - decoding: set by user. 1-> skip b frames, 2-> skip idct/dequant too, 5-> skip everything except header
  452. */
  453. int hurry_up;
  454. struct AVCodec *codec;
  455. void *priv_data;
  456. /* The following data is for RTP friendly coding */
  457. /* By now only H.263/H.263+/MPEG4 coder honours this */
  458. int rtp_mode; /* 1 for activate RTP friendly-mode */
  459. /* highers numbers represent more error-prone */
  460. /* enviroments, by now just "1" exist */
  461. int rtp_payload_size; /* The size of the RTP payload, the coder will */
  462. /* do it's best to deliver a chunk with size */
  463. /* below rtp_payload_size, the chunk will start */
  464. /* with a start code on some codecs like H.263 */
  465. /* This doesn't take account of any particular */
  466. /* headers inside the transmited RTP payload */
  467. /* The RTP callcack: This function is called */
  468. /* every time the encoder as a packet to send */
  469. /* Depends on the encoder if the data starts */
  470. /* with a Start Code (it should) H.263 does */
  471. void (*rtp_callback)(void *data, int size, int packet_number);
  472. /* statistics, used for 2-pass encoding */
  473. int mv_bits;
  474. int header_bits;
  475. int i_tex_bits;
  476. int p_tex_bits;
  477. int i_count;
  478. int p_count;
  479. int skip_count;
  480. int misc_bits;
  481. /**
  482. * number of bits used for the previously encoded frame.
  483. * - encoding: set by lavc
  484. * - decoding: unused
  485. */
  486. int frame_bits;
  487. /**
  488. * private data of the user, can be used to carry app specific stuff.
  489. * - encoding: set by user
  490. * - decoding: set by user
  491. */
  492. void *opaque;
  493. char codec_name[32];
  494. enum CodecType codec_type; /* see CODEC_TYPE_xxx */
  495. enum CodecID codec_id; /* see CODEC_ID_xxx */
  496. /**
  497. * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
  498. * this is used to workaround some encoder bugs
  499. * - encoding: unused
  500. * - decoding: set by user, will be converted to upper case by lavc during init
  501. */
  502. unsigned int codec_tag;
  503. /**
  504. * workaround bugs in encoders which sometimes cannot be detected automatically.
  505. * - encoding: unused
  506. * - decoding: set by user
  507. */
  508. int workaround_bugs;
  509. #define FF_BUG_AUTODETECT 1 ///< autodetection
  510. #define FF_BUG_OLD_MSMPEG4 2
  511. #define FF_BUG_XVID_ILACE 4
  512. #define FF_BUG_UMP4 8
  513. #define FF_BUG_NO_PADDING 16
  514. #define FF_BUG_AC_VLC 32
  515. #define FF_BUG_QPEL_CHROMA 64
  516. #define FF_BUG_STD_QPEL 128
  517. #define FF_BUG_QPEL_CHROMA2 256
  518. #define FF_BUG_DIRECT_BLOCKSIZE 512
  519. //#define FF_BUG_FAKE_SCALABILITY 16 //autodetection should work 100%
  520. /**
  521. * luma single coeff elimination threshold.
  522. * - encoding: set by user
  523. * - decoding: unused
  524. */
  525. int luma_elim_threshold;
  526. /**
  527. * chroma single coeff elimination threshold.
  528. * - encoding: set by user
  529. * - decoding: unused
  530. */
  531. int chroma_elim_threshold;
  532. /**
  533. * strictly follow the std (MPEG4, ...).
  534. * - encoding: set by user
  535. * - decoding: unused
  536. */
  537. int strict_std_compliance;
  538. /**
  539. * qscale offset between ip and b frames.
  540. * if > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset)
  541. * if < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset)
  542. * - encoding: set by user.
  543. * - decoding: unused
  544. */
  545. float b_quant_offset;
  546. /**
  547. * error resilience higher values will detect more errors but may missdetect
  548. * some more or less valid parts as errors.
  549. * - encoding: unused
  550. * - decoding: set by user
  551. */
  552. int error_resilience;
  553. #define FF_ER_CAREFULL 1
  554. #define FF_ER_COMPLIANT 2
  555. #define FF_ER_AGGRESSIVE 3
  556. #define FF_ER_VERY_AGGRESSIVE 4
  557. /**
  558. * called at the beginning of each frame to get a buffer for it.
  559. * if pic.reference is set then the frame will be read later by lavc
  560. * - encoding: unused
  561. * - decoding: set by lavc, user can override
  562. */
  563. int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
  564. /**
  565. * called to release buffers which where allocated with get_buffer.
  566. * a released buffer can be reused in get_buffer()
  567. * pic.data[*] must be set to NULL
  568. * - encoding: unused
  569. * - decoding: set by lavc, user can override
  570. */
  571. void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic);
  572. /**
  573. * is 1 if the decoded stream contains b frames, 0 otherwise.
  574. * - encoding: unused
  575. * - decoding: set by lavc
  576. */
  577. int has_b_frames;
  578. int block_align; ///< used by some WAV based audio codecs
  579. int parse_only; /* - decoding only: if true, only parsing is done
  580. (function avcodec_parse_frame()). The frame
  581. data is returned. Only MPEG codecs support this now. */
  582. /**
  583. * 0-> h263 quant 1-> mpeg quant.
  584. * - encoding: set by user.
  585. * - decoding: unused
  586. */
  587. int mpeg_quant;
  588. /**
  589. * pass1 encoding statistics output buffer.
  590. * - encoding: set by lavc
  591. * - decoding: unused
  592. */
  593. char *stats_out;
  594. /**
  595. * pass2 encoding statistics input buffer.
  596. * concatenated stuff from stats_out of pass1 should be placed here
  597. * - encoding: allocated/set/freed by user
  598. * - decoding: unused
  599. */
  600. char *stats_in;
  601. /**
  602. * ratecontrol qmin qmax limiting method.
  603. * 0-> clipping, 1-> use a nice continous function to limit qscale wthin qmin/qmax
  604. * - encoding: set by user.
  605. * - decoding: unused
  606. */
  607. float rc_qsquish;
  608. float rc_qmod_amp;
  609. int rc_qmod_freq;
  610. /**
  611. * ratecontrol override, see RcOverride.
  612. * - encoding: allocated/set/freed by user.
  613. * - decoding: unused
  614. */
  615. RcOverride *rc_override;
  616. int rc_override_count;
  617. /**
  618. * rate control equation.
  619. * - encoding: set by user
  620. * - decoding: unused
  621. */
  622. char *rc_eq;
  623. /**
  624. * maximum bitrate.
  625. * - encoding: set by user.
  626. * - decoding: unused
  627. */
  628. int rc_max_rate;
  629. /**
  630. * minimum bitrate.
  631. * - encoding: set by user.
  632. * - decoding: unused
  633. */
  634. int rc_min_rate;
  635. /**
  636. * decoder bitstream buffer size.
  637. * - encoding: set by user.
  638. * - decoding: unused
  639. */
  640. int rc_buffer_size;
  641. float rc_buffer_aggressivity;
  642. /**
  643. * qscale factor between p and i frames.
  644. * - encoding: set by user.
  645. * - decoding: unused
  646. */
  647. float i_quant_factor;
  648. /**
  649. * qscale offset between p and i frames.
  650. * if > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset)
  651. * if < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset)
  652. * - encoding: set by user.
  653. * - decoding: unused
  654. */
  655. float i_quant_offset;
  656. /**
  657. * initial complexity for pass1 ratecontrol.
  658. * - encoding: set by user.
  659. * - decoding: unused
  660. */
  661. float rc_initial_cplx;
  662. /**
  663. * dct algorithm, see FF_DCT_* below.
  664. * - encoding: set by user
  665. * - decoding: unused
  666. */
  667. int dct_algo;
  668. #define FF_DCT_AUTO 0
  669. #define FF_DCT_FASTINT 1
  670. #define FF_DCT_INT 2
  671. #define FF_DCT_MMX 3
  672. #define FF_DCT_MLIB 4
  673. #define FF_DCT_ALTIVEC 5
  674. /**
  675. * luminance masking (0-> disabled).
  676. * - encoding: set by user
  677. * - decoding: unused
  678. */
  679. float lumi_masking;
  680. /**
  681. * temporary complexity masking (0-> disabled).
  682. * - encoding: set by user
  683. * - decoding: unused
  684. */
  685. float temporal_cplx_masking;
  686. /**
  687. * spatial complexity masking (0-> disabled).
  688. * - encoding: set by user
  689. * - decoding: unused
  690. */
  691. float spatial_cplx_masking;
  692. /**
  693. * p block masking (0-> disabled).
  694. * - encoding: set by user
  695. * - decoding: unused
  696. */
  697. float p_masking;
  698. /**
  699. * darkness masking (0-> disabled).
  700. * - encoding: set by user
  701. * - decoding: unused
  702. */
  703. float dark_masking;
  704. /**
  705. * idct algorithm, see FF_IDCT_* below.
  706. * - encoding: set by user
  707. * - decoding: set by user
  708. */
  709. int idct_algo;
  710. #define FF_IDCT_AUTO 0
  711. #define FF_IDCT_INT 1
  712. #define FF_IDCT_SIMPLE 2
  713. #define FF_IDCT_SIMPLEMMX 3
  714. #define FF_IDCT_LIBMPEG2MMX 4
  715. #define FF_IDCT_PS2 5
  716. #define FF_IDCT_MLIB 6
  717. #define FF_IDCT_ARM 7
  718. #define FF_IDCT_ALTIVEC 8
  719. /**
  720. * slice count.
  721. * - encoding: set by lavc
  722. * - decoding: set by user (or 0)
  723. */
  724. int slice_count;
  725. /**
  726. * slice offsets in the frame in bytes.
  727. * - encoding: set/allocated by lavc
  728. * - decoding: set/allocated by user (or NULL)
  729. */
  730. int *slice_offset;
  731. /**
  732. * error concealment flags.
  733. * - encoding: unused
  734. * - decoding: set by user
  735. */
  736. int error_concealment;
  737. #define FF_EC_GUESS_MVS 1
  738. #define FF_EC_DEBLOCK 2
  739. /**
  740. * dsp_mask could be add used to disable unwanted CPU features
  741. * CPU features (i.e. MMX, SSE. ...)
  742. *
  743. * with FORCE flag you may instead enable given CPU features
  744. * (Dangerous: usable in case of misdetection, improper usage however will
  745. * result into program crash)
  746. */
  747. unsigned dsp_mask;
  748. #define FF_MM_FORCE 0x80000000 /* force usage of selected flags (OR) */
  749. /* lower 16 bits - CPU features */
  750. #ifdef HAVE_MMX
  751. #define FF_MM_MMX 0x0001 /* standard MMX */
  752. #define FF_MM_3DNOW 0x0004 /* AMD 3DNOW */
  753. #define FF_MM_MMXEXT 0x0002 /* SSE integer functions or AMD MMX ext */
  754. #define FF_MM_SSE 0x0008 /* SSE functions */
  755. #define FF_MM_SSE2 0x0010 /* PIV SSE2 functions */
  756. #endif /* HAVE_MMX */
  757. /**
  758. * bits per sample/pixel from the demuxer (needed for huffyuv).
  759. * - encoding: set by lavc
  760. * - decoding: set by user
  761. */
  762. int bits_per_sample;
  763. /**
  764. * prediction method (needed for huffyuv).
  765. * - encoding: set by user
  766. * - decoding: unused
  767. */
  768. int prediction_method;
  769. #define FF_PRED_LEFT 0
  770. #define FF_PRED_PLANE 1
  771. #define FF_PRED_MEDIAN 2
  772. /**
  773. * aspect ratio (0 if unknown).
  774. * - encoding: set by user.
  775. * - decoding: set by lavc.
  776. */
  777. float aspect_ratio;
  778. /**
  779. * the picture in the bitstream.
  780. * - encoding: set by lavc
  781. * - decoding: set by lavc
  782. */
  783. AVFrame *coded_frame;
  784. /**
  785. * debug.
  786. * - encoding: set by user.
  787. * - decoding: set by user.
  788. */
  789. int debug;
  790. #define FF_DEBUG_PICT_INFO 1
  791. #define FF_DEBUG_RC 2
  792. #define FF_DEBUG_BITSTREAM 4
  793. #define FF_DEBUG_MB_TYPE 8
  794. #define FF_DEBUG_QP 16
  795. #define FF_DEBUG_MV 32
  796. #define FF_DEBUG_VIS_MV 0x00000040
  797. #define FF_DEBUG_SKIP 0x00000080
  798. #define FF_DEBUG_STARTCODE 0x00000100
  799. #define FF_DEBUG_PTS 0x00000200
  800. /**
  801. * error.
  802. * - encoding: set by lavc if flags&CODEC_FLAG_PSNR
  803. * - decoding: unused
  804. */
  805. uint64_t error[4];
  806. /**
  807. * minimum MB quantizer.
  808. * - encoding: set by user.
  809. * - decoding: unused
  810. */
  811. int mb_qmin;
  812. /**
  813. * maximum MB quantizer.
  814. * - encoding: set by user.
  815. * - decoding: unused
  816. */
  817. int mb_qmax;
  818. /**
  819. * motion estimation compare function.
  820. * - encoding: set by user.
  821. * - decoding: unused
  822. */
  823. int me_cmp;
  824. /**
  825. * subpixel motion estimation compare function.
  826. * - encoding: set by user.
  827. * - decoding: unused
  828. */
  829. int me_sub_cmp;
  830. /**
  831. * macroblock compare function (not supported yet).
  832. * - encoding: set by user.
  833. * - decoding: unused
  834. */
  835. int mb_cmp;
  836. #define FF_CMP_SAD 0
  837. #define FF_CMP_SSE 1
  838. #define FF_CMP_SATD 2
  839. #define FF_CMP_DCT 3
  840. #define FF_CMP_PSNR 4
  841. #define FF_CMP_BIT 5
  842. #define FF_CMP_RD 6
  843. #define FF_CMP_ZERO 7
  844. #define FF_CMP_CHROMA 256
  845. /**
  846. * ME diamond size & shape.
  847. * - encoding: set by user.
  848. * - decoding: unused
  849. */
  850. int dia_size;
  851. /**
  852. * amount of previous MV predictors (2a+1 x 2a+1 square).
  853. * - encoding: set by user.
  854. * - decoding: unused
  855. */
  856. int last_predictor_count;
  857. /**
  858. * pre pass for motion estimation.
  859. * - encoding: set by user.
  860. * - decoding: unused
  861. */
  862. int pre_me;
  863. /**
  864. * motion estimation pre pass compare function.
  865. * - encoding: set by user.
  866. * - decoding: unused
  867. */
  868. int me_pre_cmp;
  869. /**
  870. * ME pre pass diamond size & shape.
  871. * - encoding: set by user.
  872. * - decoding: unused
  873. */
  874. int pre_dia_size;
  875. /**
  876. * subpel ME quality.
  877. * - encoding: set by user.
  878. * - decoding: unused
  879. */
  880. int me_subpel_quality;
  881. /**
  882. * callback to negotiate the pixelFormat.
  883. * @param fmt is the list of formats which are supported by the codec,
  884. * its terminated by -1 as 0 is a valid format, the formats are ordered by quality
  885. * the first is allways the native one
  886. * @return the choosen format
  887. * - encoding: unused
  888. * - decoding: set by user, if not set then the native format will always be choosen
  889. */
  890. enum PixelFormat (*get_format)(struct AVCodecContext *s, enum PixelFormat * fmt);
  891. /**
  892. * DTG active format information (additionnal aspect ratio
  893. * information only used in DVB MPEG2 transport streams). 0 if
  894. * not set.
  895. *
  896. * - encoding: unused.
  897. * - decoding: set by decoder
  898. */
  899. int dtg_active_format;
  900. #define FF_DTG_AFD_SAME 8
  901. #define FF_DTG_AFD_4_3 9
  902. #define FF_DTG_AFD_16_9 10
  903. #define FF_DTG_AFD_14_9 11
  904. #define FF_DTG_AFD_4_3_SP_14_9 13
  905. #define FF_DTG_AFD_16_9_SP_14_9 14
  906. #define FF_DTG_AFD_SP_4_3 15
  907. int me_range;
  908. /**
  909. * Maximum motion estimation search range in subpel units.
  910. * if 0 then no limit
  911. *
  912. * - encoding: set by user.
  913. * - decoding: unused.
  914. */
  915. } AVCodecContext;
  916. /**
  917. * AVOption.
  918. */
  919. typedef struct AVOption {
  920. /** options' name */
  921. const char *name; /* if name is NULL, it indicates a link to next */
  922. /** short English text help or const struct AVOption* subpointer */
  923. const char *help; // const struct AVOption* sub;
  924. /** offset to context structure where the parsed value should be stored */
  925. int offset;
  926. /** options' type */
  927. int type;
  928. #define FF_OPT_TYPE_BOOL 1 ///< boolean - true,1,on (or simply presence)
  929. #define FF_OPT_TYPE_DOUBLE 2 ///< double
  930. #define FF_OPT_TYPE_INT 3 ///< integer
  931. #define FF_OPT_TYPE_STRING 4 ///< string (finished with \0)
  932. #define FF_OPT_TYPE_MASK 0x1f ///< mask for types - upper bits are various flags
  933. //#define FF_OPT_TYPE_EXPERT 0x20 // flag for expert option
  934. #define FF_OPT_TYPE_FLAG (FF_OPT_TYPE_BOOL | 0x40)
  935. #define FF_OPT_TYPE_RCOVERRIDE (FF_OPT_TYPE_STRING | 0x80)
  936. /** min value (min == max -> no limits) */
  937. double min;
  938. /** maximum value for double/int */
  939. double max;
  940. /** default boo [0,1]l/double/int value */
  941. double defval;
  942. /**
  943. * default string value (with optional semicolon delimited extra option-list
  944. * i.e. option1;option2;option3
  945. * defval might select other then first argument as default
  946. */
  947. const char *defstr;
  948. #define FF_OPT_MAX_DEPTH 10
  949. } AVOption;
  950. /**
  951. * Parse option(s) and sets fields in passed structure
  952. * @param strct structure where the parsed results will be written
  953. * @param list list with AVOptions
  954. * @param opts string with options for parsing
  955. */
  956. int avoption_parse(void* strct, const AVOption* list, const char* opts);
  957. /**
  958. * AVCodec.
  959. */
  960. typedef struct AVCodec {
  961. const char *name;
  962. int type;
  963. int id;
  964. int priv_data_size;
  965. int (*init)(AVCodecContext *);
  966. int (*encode)(AVCodecContext *, uint8_t *buf, int buf_size, void *data);
  967. int (*close)(AVCodecContext *);
  968. int (*decode)(AVCodecContext *, void *outdata, int *outdata_size,
  969. uint8_t *buf, int buf_size);
  970. int capabilities;
  971. const AVOption *options;
  972. struct AVCodec *next;
  973. } AVCodec;
  974. /**
  975. * four components are given, that's all.
  976. * the last component is alpha
  977. */
  978. typedef struct AVPicture {
  979. uint8_t *data[4];
  980. int linesize[4];
  981. } AVPicture;
  982. extern AVCodec ac3_encoder;
  983. extern AVCodec mp2_encoder;
  984. extern AVCodec mp3lame_encoder;
  985. extern AVCodec oggvorbis_encoder;
  986. extern AVCodec mpeg1video_encoder;
  987. extern AVCodec h263_encoder;
  988. extern AVCodec h263p_encoder;
  989. extern AVCodec rv10_encoder;
  990. extern AVCodec mjpeg_encoder;
  991. extern AVCodec mpeg4_encoder;
  992. extern AVCodec msmpeg4v1_encoder;
  993. extern AVCodec msmpeg4v2_encoder;
  994. extern AVCodec msmpeg4v3_encoder;
  995. extern AVCodec wmv1_encoder;
  996. extern AVCodec wmv2_encoder;
  997. extern AVCodec huffyuv_encoder;
  998. extern AVCodec h263_decoder;
  999. extern AVCodec mpeg4_decoder;
  1000. extern AVCodec msmpeg4v1_decoder;
  1001. extern AVCodec msmpeg4v2_decoder;
  1002. extern AVCodec msmpeg4v3_decoder;
  1003. extern AVCodec wmv1_decoder;
  1004. extern AVCodec wmv2_decoder;
  1005. extern AVCodec mpeg_decoder;
  1006. extern AVCodec h263i_decoder;
  1007. extern AVCodec rv10_decoder;
  1008. extern AVCodec svq1_decoder;
  1009. extern AVCodec dvvideo_decoder;
  1010. extern AVCodec dvaudio_decoder;
  1011. extern AVCodec wmav1_decoder;
  1012. extern AVCodec wmav2_decoder;
  1013. extern AVCodec mjpeg_decoder;
  1014. extern AVCodec mjpegb_decoder;
  1015. extern AVCodec mp2_decoder;
  1016. extern AVCodec mp3_decoder;
  1017. extern AVCodec mace3_decoder;
  1018. extern AVCodec mace6_decoder;
  1019. extern AVCodec huffyuv_decoder;
  1020. extern AVCodec oggvorbis_decoder;
  1021. extern AVCodec cyuv_decoder;
  1022. /* pcm codecs */
  1023. #define PCM_CODEC(id, name) \
  1024. extern AVCodec name ## _decoder; \
  1025. extern AVCodec name ## _encoder
  1026. PCM_CODEC(CODEC_ID_PCM_S16LE, pcm_s16le);
  1027. PCM_CODEC(CODEC_ID_PCM_S16BE, pcm_s16be);
  1028. PCM_CODEC(CODEC_ID_PCM_U16LE, pcm_u16le);
  1029. PCM_CODEC(CODEC_ID_PCM_U16BE, pcm_u16be);
  1030. PCM_CODEC(CODEC_ID_PCM_S8, pcm_s8);
  1031. PCM_CODEC(CODEC_ID_PCM_U8, pcm_u8);
  1032. PCM_CODEC(CODEC_ID_PCM_ALAW, pcm_alaw);
  1033. PCM_CODEC(CODEC_ID_PCM_MULAW, pcm_mulaw);
  1034. /* adpcm codecs */
  1035. PCM_CODEC(CODEC_ID_ADPCM_IMA_QT, adpcm_ima_qt);
  1036. PCM_CODEC(CODEC_ID_ADPCM_IMA_WAV, adpcm_ima_wav);
  1037. PCM_CODEC(CODEC_ID_ADPCM_MS, adpcm_ms);
  1038. #undef PCM_CODEC
  1039. /* dummy raw video codec */
  1040. extern AVCodec rawvideo_codec;
  1041. /* the following codecs use external GPL libs */
  1042. extern AVCodec ac3_decoder;
  1043. /* resample.c */
  1044. struct ReSampleContext;
  1045. typedef struct ReSampleContext ReSampleContext;
  1046. ReSampleContext *audio_resample_init(int output_channels, int input_channels,
  1047. int output_rate, int input_rate);
  1048. int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples);
  1049. void audio_resample_close(ReSampleContext *s);
  1050. /* YUV420 format is assumed ! */
  1051. struct ImgReSampleContext;
  1052. typedef struct ImgReSampleContext ImgReSampleContext;
  1053. ImgReSampleContext *img_resample_init(int output_width, int output_height,
  1054. int input_width, int input_height);
  1055. ImgReSampleContext *img_resample_full_init(int owidth, int oheight,
  1056. int iwidth, int iheight,
  1057. int topBand, int bottomBand,
  1058. int leftBand, int rightBand);
  1059. void img_resample(ImgReSampleContext *s,
  1060. AVPicture *output, AVPicture *input);
  1061. void img_resample_close(ImgReSampleContext *s);
  1062. int avpicture_fill(AVPicture *picture, uint8_t *ptr,
  1063. int pix_fmt, int width, int height);
  1064. int avpicture_get_size(int pix_fmt, int width, int height);
  1065. void avcodec_get_chroma_sub_sample(int pix_fmt, int *h_shift, int *v_shift);
  1066. const char *avcodec_get_pix_fmt_name(int pix_fmt);
  1067. /* convert among pixel formats */
  1068. int img_convert(AVPicture *dst, int dst_pix_fmt,
  1069. AVPicture *src, int pix_fmt,
  1070. int width, int height);
  1071. /* deinterlace a picture */
  1072. int avpicture_deinterlace(AVPicture *dst, AVPicture *src,
  1073. int pix_fmt, int width, int height);
  1074. /* external high level API */
  1075. extern AVCodec *first_avcodec;
  1076. /* returns LIBAVCODEC_VERSION_INT constant */
  1077. unsigned avcodec_version(void);
  1078. /* returns LIBAVCODEC_BUILD constant */
  1079. unsigned avcodec_build(void);
  1080. void avcodec_init(void);
  1081. void register_avcodec(AVCodec *format);
  1082. AVCodec *avcodec_find_encoder(enum CodecID id);
  1083. AVCodec *avcodec_find_encoder_by_name(const char *name);
  1084. AVCodec *avcodec_find_decoder(enum CodecID id);
  1085. AVCodec *avcodec_find_decoder_by_name(const char *name);
  1086. void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
  1087. void avcodec_get_context_defaults(AVCodecContext *s);
  1088. AVCodecContext *avcodec_alloc_context(void);
  1089. AVFrame *avcodec_alloc_frame(void);
  1090. int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic);
  1091. void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic);
  1092. int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
  1093. int avcodec_decode_audio(AVCodecContext *avctx, int16_t *samples,
  1094. int *frame_size_ptr,
  1095. uint8_t *buf, int buf_size);
  1096. int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
  1097. int *got_picture_ptr,
  1098. uint8_t *buf, int buf_size);
  1099. int avcodec_parse_frame(AVCodecContext *avctx, uint8_t **pdata,
  1100. int *data_size_ptr,
  1101. uint8_t *buf, int buf_size);
  1102. int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size,
  1103. const short *samples);
  1104. int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
  1105. const AVFrame *pict);
  1106. int avcodec_close(AVCodecContext *avctx);
  1107. void avcodec_register_all(void);
  1108. void avcodec_flush_buffers(AVCodecContext *avctx);
  1109. /* misc usefull functions */
  1110. /**
  1111. * reduce a fraction.
  1112. * this is usefull for framerate calculations
  1113. * @param max the maximum allowed for dst_nom & dst_den
  1114. * @return 1 if exact, 0 otherwise
  1115. */
  1116. int av_reduce(int *dst_nom, int *dst_den, int64_t nom, int64_t den, int64_t max);
  1117. /**
  1118. * rescale a 64bit integer.
  1119. * a simple a*b/c isnt possible as it can overflow
  1120. */
  1121. int64_t av_rescale(int64_t a, int b, int c);
  1122. /**
  1123. * Interface for 0.5.0 version
  1124. *
  1125. * do not even think about it's usage for this moment
  1126. */
  1127. typedef struct {
  1128. /// compressed size used from given memory buffer
  1129. int size;
  1130. /// I/P/B frame type
  1131. int frame_type;
  1132. } avc_enc_result_t;
  1133. /**
  1134. * Commands
  1135. * order can't be changed - once it was defined
  1136. */
  1137. typedef enum {
  1138. // general commands
  1139. AVC_OPEN_BY_NAME = 0xACA000,
  1140. AVC_OPEN_BY_CODEC_ID,
  1141. AVC_OPEN_BY_FOURCC,
  1142. AVC_CLOSE,
  1143. AVC_FLUSH,
  1144. // pin - struct { uint8_t* src, uint_t src_size }
  1145. // pout - struct { AVPicture* img, consumed_bytes,
  1146. AVC_DECODE,
  1147. // pin - struct { AVPicture* img, uint8_t* dest, uint_t dest_size }
  1148. // pout - uint_t used_from_dest_size
  1149. AVC_ENCODE,
  1150. // query/get video commands
  1151. AVC_GET_VERSION = 0xACB000,
  1152. AVC_GET_WIDTH,
  1153. AVC_GET_HEIGHT,
  1154. AVC_GET_DELAY,
  1155. AVC_GET_QUANT_TABLE,
  1156. // ...
  1157. // query/get audio commands
  1158. AVC_GET_FRAME_SIZE = 0xABC000,
  1159. // maybe define some simple structure which
  1160. // might be passed to the user - but they can't
  1161. // contain any codec specific parts and these
  1162. // calls are usualy necessary only few times
  1163. // set video commands
  1164. AVC_SET_WIDTH = 0xACD000,
  1165. AVC_SET_HEIGHT,
  1166. // set video encoding commands
  1167. AVC_SET_FRAME_RATE = 0xACD800,
  1168. AVC_SET_QUALITY,
  1169. AVC_SET_HURRY_UP,
  1170. // set audio commands
  1171. AVC_SET_SAMPLE_RATE = 0xACE000,
  1172. AVC_SET_CHANNELS,
  1173. } avc_cmd_t;
  1174. /**
  1175. * \param handle allocated private structure by libavcodec
  1176. * for initialization pass NULL - will be returned pout
  1177. * user is supposed to know nothing about its structure
  1178. * \param cmd type of operation to be performed
  1179. * \param pint input parameter
  1180. * \param pout output parameter
  1181. *
  1182. * \returns command status - eventually for query command it might return
  1183. * integer resulting value
  1184. */
  1185. int avcodec(void* handle, avc_cmd_t cmd, void* pin, void* pout);
  1186. /* memory */
  1187. void *av_malloc(unsigned int size);
  1188. void *av_mallocz(unsigned int size);
  1189. void *av_realloc(void *ptr, unsigned int size);
  1190. void av_free(void *ptr);
  1191. char *av_strdup(const char *s);
  1192. void __av_freep(void **ptr);
  1193. #define av_freep(p) __av_freep((void **)(p))
  1194. void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size);
  1195. /* for static data only */
  1196. /* call av_free_static to release all staticaly allocated tables */
  1197. void av_free_static(void);
  1198. void *__av_mallocz_static(void** location, unsigned int size);
  1199. #define av_mallocz_static(p, s) __av_mallocz_static((void **)(p), s)
  1200. #ifdef __cplusplus
  1201. }
  1202. #endif
  1203. #endif /* AVCODEC_H */