vp8cx.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726
  1. /*
  2. * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #ifndef VPX_VP8CX_H_
  11. #define VPX_VP8CX_H_
  12. /*!\defgroup vp8_encoder WebM VP8/VP9 Encoder
  13. * \ingroup vp8
  14. *
  15. * @{
  16. */
  17. #include "./vp8.h"
  18. #include "./vpx_encoder.h"
  19. /*!\file
  20. * \brief Provides definitions for using VP8 or VP9 encoder algorithm within the
  21. * vpx Codec Interface.
  22. */
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. /*!\name Algorithm interface for VP8
  27. *
  28. * This interface provides the capability to encode raw VP8 streams.
  29. * @{
  30. */
  31. extern vpx_codec_iface_t vpx_codec_vp8_cx_algo;
  32. extern vpx_codec_iface_t *vpx_codec_vp8_cx(void);
  33. /*!@} - end algorithm interface member group*/
  34. /*!\name Algorithm interface for VP9
  35. *
  36. * This interface provides the capability to encode raw VP9 streams.
  37. * @{
  38. */
  39. extern vpx_codec_iface_t vpx_codec_vp9_cx_algo;
  40. extern vpx_codec_iface_t *vpx_codec_vp9_cx(void);
  41. /*!@} - end algorithm interface member group*/
  42. /*
  43. * Algorithm Flags
  44. */
  45. /*!\brief Don't reference the last frame
  46. *
  47. * When this flag is set, the encoder will not use the last frame as a
  48. * predictor. When not set, the encoder will choose whether to use the
  49. * last frame or not automatically.
  50. */
  51. #define VP8_EFLAG_NO_REF_LAST (1<<16)
  52. /*!\brief Don't reference the golden frame
  53. *
  54. * When this flag is set, the encoder will not use the golden frame as a
  55. * predictor. When not set, the encoder will choose whether to use the
  56. * golden frame or not automatically.
  57. */
  58. #define VP8_EFLAG_NO_REF_GF (1<<17)
  59. /*!\brief Don't reference the alternate reference frame
  60. *
  61. * When this flag is set, the encoder will not use the alt ref frame as a
  62. * predictor. When not set, the encoder will choose whether to use the
  63. * alt ref frame or not automatically.
  64. */
  65. #define VP8_EFLAG_NO_REF_ARF (1<<21)
  66. /*!\brief Don't update the last frame
  67. *
  68. * When this flag is set, the encoder will not update the last frame with
  69. * the contents of the current frame.
  70. */
  71. #define VP8_EFLAG_NO_UPD_LAST (1<<18)
  72. /*!\brief Don't update the golden frame
  73. *
  74. * When this flag is set, the encoder will not update the golden frame with
  75. * the contents of the current frame.
  76. */
  77. #define VP8_EFLAG_NO_UPD_GF (1<<22)
  78. /*!\brief Don't update the alternate reference frame
  79. *
  80. * When this flag is set, the encoder will not update the alt ref frame with
  81. * the contents of the current frame.
  82. */
  83. #define VP8_EFLAG_NO_UPD_ARF (1<<23)
  84. /*!\brief Force golden frame update
  85. *
  86. * When this flag is set, the encoder copy the contents of the current frame
  87. * to the golden frame buffer.
  88. */
  89. #define VP8_EFLAG_FORCE_GF (1<<19)
  90. /*!\brief Force alternate reference frame update
  91. *
  92. * When this flag is set, the encoder copy the contents of the current frame
  93. * to the alternate reference frame buffer.
  94. */
  95. #define VP8_EFLAG_FORCE_ARF (1<<24)
  96. /*!\brief Disable entropy update
  97. *
  98. * When this flag is set, the encoder will not update its internal entropy
  99. * model based on the entropy of this frame.
  100. */
  101. #define VP8_EFLAG_NO_UPD_ENTROPY (1<<20)
  102. /*!\brief VPx encoder control functions
  103. *
  104. * This set of macros define the control functions available for VPx
  105. * encoder interface.
  106. *
  107. * \sa #vpx_codec_control
  108. */
  109. enum vp8e_enc_control_id {
  110. /*!\brief Codec control function to set mode of entropy update in encoder.
  111. *
  112. * Supported in codecs: VP8, VP9
  113. */
  114. VP8E_UPD_ENTROPY = 5,
  115. /*!\brief Codec control function to set reference update mode in encoder.
  116. *
  117. * Supported in codecs: VP8, VP9
  118. */
  119. VP8E_UPD_REFERENCE,
  120. /*!\brief Codec control function to set which reference frame encoder can use.
  121. *
  122. * Supported in codecs: VP8, VP9
  123. */
  124. VP8E_USE_REFERENCE,
  125. /*!\brief Codec control function to pass an ROI map to encoder.
  126. *
  127. * Supported in codecs: VP8, VP9
  128. */
  129. VP8E_SET_ROI_MAP,
  130. /*!\brief Codec control function to pass an Active map to encoder.
  131. *
  132. * Supported in codecs: VP8, VP9
  133. */
  134. VP8E_SET_ACTIVEMAP,
  135. /*!\brief Codec control function to set encoder scaling mode.
  136. *
  137. * Supported in codecs: VP8, VP9
  138. */
  139. VP8E_SET_SCALEMODE = 11,
  140. /*!\brief Codec control function to set encoder internal speed settings.
  141. *
  142. * Changes in this value influences, among others, the encoder's selection
  143. * of motion estimation methods. Values greater than 0 will increase encoder
  144. * speed at the expense of quality.
  145. *
  146. * \note Valid range for VP8: -16..16
  147. * \note Valid range for VP9: -8..8
  148. *
  149. * Supported in codecs: VP8, VP9
  150. */
  151. VP8E_SET_CPUUSED = 13,
  152. /*!\brief Codec control function to enable automatic set and use alf frames.
  153. *
  154. * Supported in codecs: VP8, VP9
  155. */
  156. VP8E_SET_ENABLEAUTOALTREF,
  157. /*!\brief control function to set noise sensitivity
  158. *
  159. * 0: off, 1: OnYOnly, 2: OnYUV,
  160. * 3: OnYUVAggressive, 4: Adaptive
  161. *
  162. * Supported in codecs: VP8
  163. */
  164. VP8E_SET_NOISE_SENSITIVITY,
  165. /*!\brief Codec control function to set sharpness.
  166. *
  167. * Supported in codecs: VP8, VP9
  168. */
  169. VP8E_SET_SHARPNESS,
  170. /*!\brief Codec control function to set the threshold for MBs treated static.
  171. *
  172. * Supported in codecs: VP8, VP9
  173. */
  174. VP8E_SET_STATIC_THRESHOLD,
  175. /*!\brief Codec control function to set the number of token partitions.
  176. *
  177. * Supported in codecs: VP8
  178. */
  179. VP8E_SET_TOKEN_PARTITIONS,
  180. /*!\brief Codec control function to get last quantizer chosen by the encoder.
  181. *
  182. * Return value uses internal quantizer scale defined by the codec.
  183. *
  184. * Supported in codecs: VP8, VP9
  185. */
  186. VP8E_GET_LAST_QUANTIZER,
  187. /*!\brief Codec control function to get last quantizer chosen by the encoder.
  188. *
  189. * Return value uses the 0..63 scale as used by the rc_*_quantizer config
  190. * parameters.
  191. *
  192. * Supported in codecs: VP8, VP9
  193. */
  194. VP8E_GET_LAST_QUANTIZER_64,
  195. /*!\brief Codec control function to set the max no of frames to create arf.
  196. *
  197. * Supported in codecs: VP8, VP9
  198. */
  199. VP8E_SET_ARNR_MAXFRAMES,
  200. /*!\brief Codec control function to set the filter strength for the arf.
  201. *
  202. * Supported in codecs: VP8, VP9
  203. */
  204. VP8E_SET_ARNR_STRENGTH,
  205. /*!\deprecated control function to set the filter type to use for the arf. */
  206. VP8E_SET_ARNR_TYPE,
  207. /*!\brief Codec control function to set visual tuning.
  208. *
  209. * Supported in codecs: VP8, VP9
  210. */
  211. VP8E_SET_TUNING,
  212. /*!\brief Codec control function to set constrained quality level.
  213. *
  214. * \attention For this value to be used vpx_codec_enc_cfg_t::g_usage must be
  215. * set to #VPX_CQ.
  216. * \note Valid range: 0..63
  217. *
  218. * Supported in codecs: VP8, VP9
  219. */
  220. VP8E_SET_CQ_LEVEL,
  221. /*!\brief Codec control function to set Max data rate for Intra frames.
  222. *
  223. * This value controls additional clamping on the maximum size of a
  224. * keyframe. It is expressed as a percentage of the average
  225. * per-frame bitrate, with the special (and default) value 0 meaning
  226. * unlimited, or no additional clamping beyond the codec's built-in
  227. * algorithm.
  228. *
  229. * For example, to allocate no more than 4.5 frames worth of bitrate
  230. * to a keyframe, set this to 450.
  231. *
  232. * Supported in codecs: VP8, VP9
  233. */
  234. VP8E_SET_MAX_INTRA_BITRATE_PCT,
  235. /*!\brief Codec control function to set reference and update frame flags.
  236. *
  237. * Supported in codecs: VP8
  238. */
  239. VP8E_SET_FRAME_FLAGS,
  240. /*!\brief Codec control function to set max data rate for Inter frames.
  241. *
  242. * This value controls additional clamping on the maximum size of an
  243. * inter frame. It is expressed as a percentage of the average
  244. * per-frame bitrate, with the special (and default) value 0 meaning
  245. * unlimited, or no additional clamping beyond the codec's built-in
  246. * algorithm.
  247. *
  248. * For example, to allow no more than 4.5 frames worth of bitrate
  249. * to an inter frame, set this to 450.
  250. *
  251. * Supported in codecs: VP9
  252. */
  253. VP9E_SET_MAX_INTER_BITRATE_PCT,
  254. /*!\brief Boost percentage for Golden Frame in CBR mode.
  255. *
  256. * This value controls the amount of boost given to Golden Frame in
  257. * CBR mode. It is expressed as a percentage of the average
  258. * per-frame bitrate, with the special (and default) value 0 meaning
  259. * the feature is off, i.e., no golden frame boost in CBR mode and
  260. * average bitrate target is used.
  261. *
  262. * For example, to allow 100% more bits, i.e, 2X, in a golden frame
  263. * than average frame, set this to 100.
  264. *
  265. * Supported in codecs: VP9
  266. */
  267. VP9E_SET_GF_CBR_BOOST_PCT,
  268. /*!\brief Codec control function to set the temporal layer id.
  269. *
  270. * For temporal scalability: this control allows the application to set the
  271. * layer id for each frame to be encoded. Note that this control must be set
  272. * for every frame prior to encoding. The usage of this control function
  273. * supersedes the internal temporal pattern counter, which is now deprecated.
  274. *
  275. * Supported in codecs: VP8
  276. */
  277. VP8E_SET_TEMPORAL_LAYER_ID,
  278. /*!\brief Codec control function to set encoder screen content mode.
  279. *
  280. * 0: off, 1: On, 2: On with more aggressive rate control.
  281. *
  282. * Supported in codecs: VP8
  283. */
  284. VP8E_SET_SCREEN_CONTENT_MODE,
  285. /*!\brief Codec control function to set lossless encoding mode.
  286. *
  287. * VP9 can operate in lossless encoding mode, in which the bitstream
  288. * produced will be able to decode and reconstruct a perfect copy of
  289. * input source. This control function provides a mean to switch encoder
  290. * into lossless coding mode(1) or normal coding mode(0) that may be lossy.
  291. * 0 = lossy coding mode
  292. * 1 = lossless coding mode
  293. *
  294. * By default, encoder operates in normal coding mode (maybe lossy).
  295. *
  296. * Supported in codecs: VP9
  297. */
  298. VP9E_SET_LOSSLESS,
  299. /*!\brief Codec control function to set number of tile columns.
  300. *
  301. * In encoding and decoding, VP9 allows an input image frame be partitioned
  302. * into separated vertical tile columns, which can be encoded or decoded
  303. * independently. This enables easy implementation of parallel encoding and
  304. * decoding. This control requests the encoder to use column tiles in
  305. * encoding an input frame, with number of tile columns (in Log2 unit) as
  306. * the parameter:
  307. * 0 = 1 tile column
  308. * 1 = 2 tile columns
  309. * 2 = 4 tile columns
  310. * .....
  311. * n = 2**n tile columns
  312. * The requested tile columns will be capped by encoder based on image size
  313. * limitation (The minimum width of a tile column is 256 pixel, the maximum
  314. * is 4096).
  315. *
  316. * By default, the value is 0, i.e. one single column tile for entire image.
  317. *
  318. * Supported in codecs: VP9
  319. */
  320. VP9E_SET_TILE_COLUMNS,
  321. /*!\brief Codec control function to set number of tile rows.
  322. *
  323. * In encoding and decoding, VP9 allows an input image frame be partitioned
  324. * into separated horizontal tile rows. Tile rows are encoded or decoded
  325. * sequentially. Even though encoding/decoding of later tile rows depends on
  326. * earlier ones, this allows the encoder to output data packets for tile rows
  327. * prior to completely processing all tile rows in a frame, thereby reducing
  328. * the latency in processing between input and output. The parameter
  329. * for this control describes the number of tile rows, which has a valid
  330. * range [0, 2]:
  331. * 0 = 1 tile row
  332. * 1 = 2 tile rows
  333. * 2 = 4 tile rows
  334. *
  335. * By default, the value is 0, i.e. one single row tile for entire image.
  336. *
  337. * Supported in codecs: VP9
  338. */
  339. VP9E_SET_TILE_ROWS,
  340. /*!\brief Codec control function to enable frame parallel decoding feature.
  341. *
  342. * VP9 has a bitstream feature to reduce decoding dependency between frames
  343. * by turning off backward update of probability context used in encoding
  344. * and decoding. This allows staged parallel processing of more than one
  345. * video frames in the decoder. This control function provides a mean to
  346. * turn this feature on or off for bitstreams produced by encoder.
  347. *
  348. * By default, this feature is off.
  349. *
  350. * Supported in codecs: VP9
  351. */
  352. VP9E_SET_FRAME_PARALLEL_DECODING,
  353. /*!\brief Codec control function to set adaptive quantization mode.
  354. *
  355. * VP9 has a segment based feature that allows encoder to adaptively change
  356. * quantization parameter for each segment within a frame to improve the
  357. * subjective quality. This control makes encoder operate in one of the
  358. * several AQ_modes supported.
  359. *
  360. * By default, encoder operates with AQ_Mode 0(adaptive quantization off).
  361. *
  362. * Supported in codecs: VP9
  363. */
  364. VP9E_SET_AQ_MODE,
  365. /*!\brief Codec control function to enable/disable periodic Q boost.
  366. *
  367. * One VP9 encoder speed feature is to enable quality boost by lowering
  368. * frame level Q periodically. This control function provides a mean to
  369. * turn on/off this feature.
  370. * 0 = off
  371. * 1 = on
  372. *
  373. * By default, the encoder is allowed to use this feature for appropriate
  374. * encoding modes.
  375. *
  376. * Supported in codecs: VP9
  377. */
  378. VP9E_SET_FRAME_PERIODIC_BOOST,
  379. /*!\brief Codec control function to set noise sensitivity.
  380. *
  381. * 0: off, 1: On(YOnly)
  382. *
  383. * Supported in codecs: VP9
  384. */
  385. VP9E_SET_NOISE_SENSITIVITY,
  386. /*!\brief Codec control function to turn on/off SVC in encoder.
  387. * \note Return value is VPX_CODEC_INVALID_PARAM if the encoder does not
  388. * support SVC in its current encoding mode
  389. * 0: off, 1: on
  390. *
  391. * Supported in codecs: VP9
  392. */
  393. VP9E_SET_SVC,
  394. /*!\brief Codec control function to set parameters for SVC.
  395. * \note Parameters contain min_q, max_q, scaling factor for each of the
  396. * SVC layers.
  397. *
  398. * Supported in codecs: VP9
  399. */
  400. VP9E_SET_SVC_PARAMETERS,
  401. /*!\brief Codec control function to set svc layer for spatial and temporal.
  402. * \note Valid ranges: 0..#vpx_codec_enc_cfg::ss_number_layers for spatial
  403. * layer and 0..#vpx_codec_enc_cfg::ts_number_layers for
  404. * temporal layer.
  405. *
  406. * Supported in codecs: VP9
  407. */
  408. VP9E_SET_SVC_LAYER_ID,
  409. /*!\brief Codec control function to set content type.
  410. * \note Valid parameter range:
  411. * VP9E_CONTENT_DEFAULT = Regular video content (Default)
  412. * VP9E_CONTENT_SCREEN = Screen capture content
  413. *
  414. * Supported in codecs: VP9
  415. */
  416. VP9E_SET_TUNE_CONTENT,
  417. /*!\brief Codec control function to get svc layer ID.
  418. * \note The layer ID returned is for the data packet from the registered
  419. * callback function.
  420. *
  421. * Supported in codecs: VP9
  422. */
  423. VP9E_GET_SVC_LAYER_ID,
  424. /*!\brief Codec control function to register callback to get per layer packet.
  425. * \note Parameter for this control function is a structure with a callback
  426. * function and a pointer to private data used by the callback.
  427. *
  428. * Supported in codecs: VP9
  429. */
  430. VP9E_REGISTER_CX_CALLBACK,
  431. /*!\brief Codec control function to set color space info.
  432. * \note Valid ranges: 0..7, default is "UNKNOWN".
  433. * 0 = UNKNOWN,
  434. * 1 = BT_601
  435. * 2 = BT_709
  436. * 3 = SMPTE_170
  437. * 4 = SMPTE_240
  438. * 5 = BT_2020
  439. * 6 = RESERVED
  440. * 7 = SRGB
  441. *
  442. * Supported in codecs: VP9
  443. */
  444. VP9E_SET_COLOR_SPACE,
  445. /*!\brief Codec control function to set temporal layering mode.
  446. * \note Valid ranges: 0..3, default is "0" (VP9E_TEMPORAL_LAYERING_MODE_NOLAYERING).
  447. * 0 = VP9E_TEMPORAL_LAYERING_MODE_NOLAYERING
  448. * 1 = VP9E_TEMPORAL_LAYERING_MODE_BYPASS
  449. * 2 = VP9E_TEMPORAL_LAYERING_MODE_0101
  450. * 3 = VP9E_TEMPORAL_LAYERING_MODE_0212
  451. *
  452. * Supported in codecs: VP9
  453. */
  454. VP9E_SET_TEMPORAL_LAYERING_MODE,
  455. /*!\brief Codec control function to get an Active map back from the encoder.
  456. *
  457. * Supported in codecs: VP9
  458. */
  459. VP9E_GET_ACTIVEMAP,
  460. };
  461. /*!\brief vpx 1-D scaling mode
  462. *
  463. * This set of constants define 1-D vpx scaling modes
  464. */
  465. typedef enum vpx_scaling_mode_1d {
  466. VP8E_NORMAL = 0,
  467. VP8E_FOURFIVE = 1,
  468. VP8E_THREEFIVE = 2,
  469. VP8E_ONETWO = 3
  470. } VPX_SCALING_MODE;
  471. /*!\brief Temporal layering mode enum for VP9 SVC.
  472. *
  473. * This set of macros define the different temporal layering modes.
  474. * Supported codecs: VP9 (in SVC mode)
  475. *
  476. */
  477. typedef enum vp9e_temporal_layering_mode {
  478. /*!\brief No temporal layering.
  479. * Used when only spatial layering is used.
  480. */
  481. VP9E_TEMPORAL_LAYERING_MODE_NOLAYERING = 0,
  482. /*!\brief Bypass mode.
  483. * Used when application needs to control temporal layering.
  484. * This will only work when the number of spatial layers equals 1.
  485. */
  486. VP9E_TEMPORAL_LAYERING_MODE_BYPASS = 1,
  487. /*!\brief 0-1-0-1... temporal layering scheme with two temporal layers.
  488. */
  489. VP9E_TEMPORAL_LAYERING_MODE_0101 = 2,
  490. /*!\brief 0-2-1-2... temporal layering scheme with three temporal layers.
  491. */
  492. VP9E_TEMPORAL_LAYERING_MODE_0212 = 3
  493. } VP9E_TEMPORAL_LAYERING_MODE;
  494. /*!\brief vpx region of interest map
  495. *
  496. * These defines the data structures for the region of interest map
  497. *
  498. */
  499. typedef struct vpx_roi_map {
  500. /*! An id between 0 and 3 for each 16x16 region within a frame. */
  501. unsigned char *roi_map;
  502. unsigned int rows; /**< Number of rows. */
  503. unsigned int cols; /**< Number of columns. */
  504. // TODO(paulwilkins): broken for VP9 which has 8 segments
  505. // q and loop filter deltas for each segment
  506. // (see MAX_MB_SEGMENTS)
  507. int delta_q[4]; /**< Quantizer deltas. */
  508. int delta_lf[4]; /**< Loop filter deltas. */
  509. /*! Static breakout threshold for each segment. */
  510. unsigned int static_threshold[4];
  511. } vpx_roi_map_t;
  512. /*!\brief vpx active region map
  513. *
  514. * These defines the data structures for active region map
  515. *
  516. */
  517. typedef struct vpx_active_map {
  518. unsigned char *active_map; /**< specify an on (1) or off (0) each 16x16 region within a frame */
  519. unsigned int rows; /**< number of rows */
  520. unsigned int cols; /**< number of cols */
  521. } vpx_active_map_t;
  522. /*!\brief vpx image scaling mode
  523. *
  524. * This defines the data structure for image scaling mode
  525. *
  526. */
  527. typedef struct vpx_scaling_mode {
  528. VPX_SCALING_MODE h_scaling_mode; /**< horizontal scaling mode */
  529. VPX_SCALING_MODE v_scaling_mode; /**< vertical scaling mode */
  530. } vpx_scaling_mode_t;
  531. /*!\brief VP8 token partition mode
  532. *
  533. * This defines VP8 partitioning mode for compressed data, i.e., the number of
  534. * sub-streams in the bitstream. Used for parallelized decoding.
  535. *
  536. */
  537. typedef enum {
  538. VP8_ONE_TOKENPARTITION = 0,
  539. VP8_TWO_TOKENPARTITION = 1,
  540. VP8_FOUR_TOKENPARTITION = 2,
  541. VP8_EIGHT_TOKENPARTITION = 3
  542. } vp8e_token_partitions;
  543. /*!brief VP9 encoder content type */
  544. typedef enum {
  545. VP9E_CONTENT_DEFAULT,
  546. VP9E_CONTENT_SCREEN,
  547. VP9E_CONTENT_INVALID
  548. } vp9e_tune_content;
  549. /*!\brief VP8 model tuning parameters
  550. *
  551. * Changes the encoder to tune for certain types of input material.
  552. *
  553. */
  554. typedef enum {
  555. VP8_TUNE_PSNR,
  556. VP8_TUNE_SSIM
  557. } vp8e_tuning;
  558. /*!\brief vp9 svc layer parameters
  559. *
  560. * This defines the spatial and temporal layer id numbers for svc encoding.
  561. * This is used with the #VP9E_SET_SVC_LAYER_ID control to set the spatial and
  562. * temporal layer id for the current frame.
  563. *
  564. */
  565. typedef struct vpx_svc_layer_id {
  566. int spatial_layer_id; /**< Spatial layer id number. */
  567. int temporal_layer_id; /**< Temporal layer id number. */
  568. } vpx_svc_layer_id_t;
  569. /*!\brief VP8 encoder control function parameter type
  570. *
  571. * Defines the data types that VP8E control functions take. Note that
  572. * additional common controls are defined in vp8.h
  573. *
  574. */
  575. /* These controls have been deprecated in favor of the flags parameter to
  576. * vpx_codec_encode(). See the definition of VP8_EFLAG_* above.
  577. */
  578. VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_UPD_ENTROPY, int)
  579. VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_UPD_REFERENCE, int)
  580. VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_USE_REFERENCE, int)
  581. VPX_CTRL_USE_TYPE(VP8E_SET_FRAME_FLAGS, int)
  582. VPX_CTRL_USE_TYPE(VP8E_SET_TEMPORAL_LAYER_ID, int)
  583. VPX_CTRL_USE_TYPE(VP8E_SET_ROI_MAP, vpx_roi_map_t *)
  584. VPX_CTRL_USE_TYPE(VP8E_SET_ACTIVEMAP, vpx_active_map_t *)
  585. VPX_CTRL_USE_TYPE(VP8E_SET_SCALEMODE, vpx_scaling_mode_t *)
  586. VPX_CTRL_USE_TYPE(VP9E_SET_SVC, int)
  587. VPX_CTRL_USE_TYPE(VP9E_SET_SVC_PARAMETERS, void *)
  588. VPX_CTRL_USE_TYPE(VP9E_REGISTER_CX_CALLBACK, void *)
  589. VPX_CTRL_USE_TYPE(VP9E_SET_SVC_LAYER_ID, vpx_svc_layer_id_t *)
  590. VPX_CTRL_USE_TYPE(VP8E_SET_CPUUSED, int)
  591. VPX_CTRL_USE_TYPE(VP8E_SET_ENABLEAUTOALTREF, unsigned int)
  592. VPX_CTRL_USE_TYPE(VP8E_SET_NOISE_SENSITIVITY, unsigned int)
  593. VPX_CTRL_USE_TYPE(VP8E_SET_SHARPNESS, unsigned int)
  594. VPX_CTRL_USE_TYPE(VP8E_SET_STATIC_THRESHOLD, unsigned int)
  595. VPX_CTRL_USE_TYPE(VP8E_SET_TOKEN_PARTITIONS, int) /* vp8e_token_partitions */
  596. VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_MAXFRAMES, unsigned int)
  597. VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_STRENGTH, unsigned int)
  598. VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_SET_ARNR_TYPE, unsigned int)
  599. VPX_CTRL_USE_TYPE(VP8E_SET_TUNING, int) /* vp8e_tuning */
  600. VPX_CTRL_USE_TYPE(VP8E_SET_CQ_LEVEL, unsigned int)
  601. VPX_CTRL_USE_TYPE(VP9E_SET_TILE_COLUMNS, int)
  602. VPX_CTRL_USE_TYPE(VP9E_SET_TILE_ROWS, int)
  603. VPX_CTRL_USE_TYPE(VP8E_GET_LAST_QUANTIZER, int *)
  604. VPX_CTRL_USE_TYPE(VP8E_GET_LAST_QUANTIZER_64, int *)
  605. VPX_CTRL_USE_TYPE(VP9E_GET_SVC_LAYER_ID, vpx_svc_layer_id_t *)
  606. VPX_CTRL_USE_TYPE(VP8E_SET_MAX_INTRA_BITRATE_PCT, unsigned int)
  607. VPX_CTRL_USE_TYPE(VP8E_SET_MAX_INTER_BITRATE_PCT, unsigned int)
  608. VPX_CTRL_USE_TYPE(VP8E_SET_SCREEN_CONTENT_MODE, unsigned int)
  609. VPX_CTRL_USE_TYPE(VP9E_SET_GF_CBR_BOOST_PCT, unsigned int)
  610. VPX_CTRL_USE_TYPE(VP9E_SET_LOSSLESS, unsigned int)
  611. VPX_CTRL_USE_TYPE(VP9E_SET_FRAME_PARALLEL_DECODING, unsigned int)
  612. VPX_CTRL_USE_TYPE(VP9E_SET_AQ_MODE, unsigned int)
  613. VPX_CTRL_USE_TYPE(VP9E_SET_FRAME_PERIODIC_BOOST, unsigned int)
  614. VPX_CTRL_USE_TYPE(VP9E_SET_NOISE_SENSITIVITY, unsigned int)
  615. VPX_CTRL_USE_TYPE(VP9E_SET_TUNE_CONTENT, int) /* vp9e_tune_content */
  616. VPX_CTRL_USE_TYPE(VP9E_SET_COLOR_SPACE, int)
  617. VPX_CTRL_USE_TYPE(VP9E_GET_ACTIVEMAP, vpx_active_map_t *)
  618. /*! @} - end defgroup vp8_encoder */
  619. #ifdef __cplusplus
  620. } // extern "C"
  621. #endif
  622. #endif // VPX_VP8CX_H_