encint.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
  1. /********************************************************************
  2. * *
  3. * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. *
  4. * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
  5. * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
  6. * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
  7. * *
  8. * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 *
  9. * by the Xiph.Org Foundation http://www.xiph.org/ *
  10. * *
  11. ********************************************************************
  12. function:
  13. last mod: $Id: encint.h 16503 2009-08-22 18:14:02Z giles $
  14. ********************************************************************/
  15. #if !defined(_encint_H)
  16. # define _encint_H (1)
  17. # if defined(HAVE_CONFIG_H)
  18. # include "config.h"
  19. # endif
  20. # include "theora/theoraenc.h"
  21. # include "internal.h"
  22. # include "ocintrin.h"
  23. # include "mathops.h"
  24. # include "enquant.h"
  25. # include "huffenc.h"
  26. /*# define OC_COLLECT_METRICS*/
  27. typedef oc_mv oc_mv2[2];
  28. typedef struct oc_enc_opt_vtable oc_enc_opt_vtable;
  29. typedef struct oc_mb_enc_info oc_mb_enc_info;
  30. typedef struct oc_mode_scheme_chooser oc_mode_scheme_chooser;
  31. typedef struct oc_iir_filter oc_iir_filter;
  32. typedef struct oc_frame_metrics oc_frame_metrics;
  33. typedef struct oc_rc_state oc_rc_state;
  34. typedef struct th_enc_ctx oc_enc_ctx;
  35. typedef struct oc_token_checkpoint oc_token_checkpoint;
  36. /*Constants for the packet-out state machine specific to the encoder.*/
  37. /*Next packet to emit: Data packet, but none are ready yet.*/
  38. #define OC_PACKET_EMPTY (0)
  39. /*Next packet to emit: Data packet, and one is ready.*/
  40. #define OC_PACKET_READY (1)
  41. /*All features enabled.*/
  42. #define OC_SP_LEVEL_SLOW (0)
  43. /*Enable early skip.*/
  44. #define OC_SP_LEVEL_EARLY_SKIP (1)
  45. /*Disable motion compensation.*/
  46. #define OC_SP_LEVEL_NOMC (2)
  47. /*Maximum valid speed level.*/
  48. #define OC_SP_LEVEL_MAX (2)
  49. /*The bits used for each of the MB mode codebooks.*/
  50. extern const unsigned char OC_MODE_BITS[2][OC_NMODES];
  51. /*The bits used for each of the MV codebooks.*/
  52. extern const unsigned char OC_MV_BITS[2][64];
  53. /*The minimum value that can be stored in a SB run for each codeword.
  54. The last entry is the upper bound on the length of a single SB run.*/
  55. extern const ogg_uint16_t OC_SB_RUN_VAL_MIN[8];
  56. /*The bits used for each SB run codeword.*/
  57. extern const unsigned char OC_SB_RUN_CODE_NBITS[7];
  58. /*The bits used for each block run length (starting with 1).*/
  59. extern const unsigned char OC_BLOCK_RUN_CODE_NBITS[30];
  60. /*Encoder specific functions with accelerated variants.*/
  61. struct oc_enc_opt_vtable{
  62. unsigned (*frag_sad)(const unsigned char *_src,
  63. const unsigned char *_ref,int _ystride);
  64. unsigned (*frag_sad_thresh)(const unsigned char *_src,
  65. const unsigned char *_ref,int _ystride,unsigned _thresh);
  66. unsigned (*frag_sad2_thresh)(const unsigned char *_src,
  67. const unsigned char *_ref1,const unsigned char *_ref2,int _ystride,
  68. unsigned _thresh);
  69. unsigned (*frag_satd_thresh)(const unsigned char *_src,
  70. const unsigned char *_ref,int _ystride,unsigned _thresh);
  71. unsigned (*frag_satd2_thresh)(const unsigned char *_src,
  72. const unsigned char *_ref1,const unsigned char *_ref2,int _ystride,
  73. unsigned _thresh);
  74. unsigned (*frag_intra_satd)(const unsigned char *_src,int _ystride);
  75. void (*frag_sub)(ogg_int16_t _diff[64],const unsigned char *_src,
  76. const unsigned char *_ref,int _ystride);
  77. void (*frag_sub_128)(ogg_int16_t _diff[64],
  78. const unsigned char *_src,int _ystride);
  79. void (*frag_copy2)(unsigned char *_dst,
  80. const unsigned char *_src1,const unsigned char *_src2,int _ystride);
  81. void (*frag_recon_intra)(unsigned char *_dst,int _ystride,
  82. const ogg_int16_t _residue[64]);
  83. void (*frag_recon_inter)(unsigned char *_dst,
  84. const unsigned char *_src,int _ystride,const ogg_int16_t _residue[64]);
  85. void (*fdct8x8)(ogg_int16_t _y[64],const ogg_int16_t _x[64]);
  86. };
  87. void oc_enc_vtable_init(oc_enc_ctx *_enc);
  88. /*Encoder-specific macroblock information.*/
  89. struct oc_mb_enc_info{
  90. /*Neighboring macro blocks that have MVs available from the current frame.*/
  91. unsigned cneighbors[4];
  92. /*Neighboring macro blocks to use for MVs from the previous frame.*/
  93. unsigned pneighbors[4];
  94. /*The number of current-frame neighbors.*/
  95. unsigned char ncneighbors;
  96. /*The number of previous-frame neighbors.*/
  97. unsigned char npneighbors;
  98. /*Flags indicating which MB modes have been refined.*/
  99. unsigned char refined;
  100. /*Motion vectors for a macro block for the current frame and the
  101. previous two frames.
  102. Each is a set of 2 vectors against OC_FRAME_GOLD and OC_FRAME_PREV, which
  103. can be used to estimate constant velocity and constant acceleration
  104. predictors.
  105. Uninitialized MVs are (0,0).*/
  106. oc_mv2 analysis_mv[3];
  107. /*Current unrefined analysis MVs.*/
  108. oc_mv unref_mv[2];
  109. /*Unrefined block MVs.*/
  110. oc_mv block_mv[4];
  111. /*Refined block MVs.*/
  112. oc_mv ref_mv[4];
  113. /*Minimum motion estimation error from the analysis stage.*/
  114. ogg_uint16_t error[2];
  115. /*MB error for half-pel refinement for each frame type.*/
  116. unsigned satd[2];
  117. /*Block error for half-pel refinement.*/
  118. unsigned block_satd[4];
  119. };
  120. /*State machine to estimate the opportunity cost of coding a MB mode.*/
  121. struct oc_mode_scheme_chooser{
  122. /*Pointers to the a list containing the index of each mode in the mode
  123. alphabet used by each scheme.
  124. The first entry points to the dynamic scheme0_ranks, while the remaining 7
  125. point to the constant entries stored in OC_MODE_SCHEMES.*/
  126. const unsigned char *mode_ranks[8];
  127. /*The ranks for each mode when coded with scheme 0.
  128. These are optimized so that the more frequent modes have lower ranks.*/
  129. unsigned char scheme0_ranks[OC_NMODES];
  130. /*The list of modes, sorted in descending order of frequency, that
  131. corresponds to the ranks above.*/
  132. unsigned char scheme0_list[OC_NMODES];
  133. /*The number of times each mode has been chosen so far.*/
  134. int mode_counts[OC_NMODES];
  135. /*The list of mode coding schemes, sorted in ascending order of bit cost.*/
  136. unsigned char scheme_list[8];
  137. /*The number of bits used by each mode coding scheme.*/
  138. ptrdiff_t scheme_bits[8];
  139. };
  140. void oc_mode_scheme_chooser_init(oc_mode_scheme_chooser *_chooser);
  141. /*A 2nd order low-pass Bessel follower.
  142. We use this for rate control because it has fast reaction time, but is
  143. critically damped.*/
  144. struct oc_iir_filter{
  145. ogg_int32_t c[2];
  146. ogg_int64_t g;
  147. ogg_int32_t x[2];
  148. ogg_int32_t y[2];
  149. };
  150. /*The 2-pass metrics associated with a single frame.*/
  151. struct oc_frame_metrics{
  152. /*The log base 2 of the scale factor for this frame in Q24 format.*/
  153. ogg_int32_t log_scale;
  154. /*The number of application-requested duplicates of this frame.*/
  155. unsigned dup_count:31;
  156. /*The frame type from pass 1.*/
  157. unsigned frame_type:1;
  158. };
  159. /*Rate control state information.*/
  160. struct oc_rc_state{
  161. /*The target average bits per frame.*/
  162. ogg_int64_t bits_per_frame;
  163. /*The current buffer fullness (bits available to be used).*/
  164. ogg_int64_t fullness;
  165. /*The target buffer fullness.
  166. This is where we'd like to be by the last keyframe the appears in the next
  167. buf_delay frames.*/
  168. ogg_int64_t target;
  169. /*The maximum buffer fullness (total size of the buffer).*/
  170. ogg_int64_t max;
  171. /*The log of the number of pixels in a frame in Q57 format.*/
  172. ogg_int64_t log_npixels;
  173. /*The exponent used in the rate model in Q8 format.*/
  174. unsigned exp[2];
  175. /*The number of frames to distribute the buffer usage over.*/
  176. int buf_delay;
  177. /*The total drop count from the previous frame.
  178. This includes duplicates explicitly requested via the
  179. TH_ENCCTL_SET_DUP_COUNT API as well as frames we chose to drop ourselves.*/
  180. ogg_uint32_t prev_drop_count;
  181. /*The log of an estimated scale factor used to obtain the real framerate, for
  182. VFR sources or, e.g., 12 fps content doubled to 24 fps, etc.*/
  183. ogg_int64_t log_drop_scale;
  184. /*The log of estimated scale factor for the rate model in Q57 format.*/
  185. ogg_int64_t log_scale[2];
  186. /*The log of the target quantizer level in Q57 format.*/
  187. ogg_int64_t log_qtarget;
  188. /*Will we drop frames to meet bitrate target?*/
  189. unsigned char drop_frames;
  190. /*Do we respect the maximum buffer fullness?*/
  191. unsigned char cap_overflow;
  192. /*Can the reservoir go negative?*/
  193. unsigned char cap_underflow;
  194. /*Second-order lowpass filters to track scale and VFR.*/
  195. oc_iir_filter scalefilter[2];
  196. int inter_count;
  197. int inter_delay;
  198. int inter_delay_target;
  199. oc_iir_filter vfrfilter;
  200. /*Two-pass mode state.
  201. 0 => 1-pass encoding.
  202. 1 => 1st pass of 2-pass encoding.
  203. 2 => 2nd pass of 2-pass encoding.*/
  204. int twopass;
  205. /*Buffer for current frame metrics.*/
  206. unsigned char twopass_buffer[48];
  207. /*The number of bytes in the frame metrics buffer.
  208. When 2-pass encoding is enabled, this is set to 0 after each frame is
  209. submitted, and must be non-zero before the next frame will be accepted.*/
  210. int twopass_buffer_bytes;
  211. int twopass_buffer_fill;
  212. /*Whether or not to force the next frame to be a keyframe.*/
  213. unsigned char twopass_force_kf;
  214. /*The metrics for the previous frame.*/
  215. oc_frame_metrics prev_metrics;
  216. /*The metrics for the current frame.*/
  217. oc_frame_metrics cur_metrics;
  218. /*The buffered metrics for future frames.*/
  219. oc_frame_metrics *frame_metrics;
  220. int nframe_metrics;
  221. int cframe_metrics;
  222. /*The index of the current frame in the circular metric buffer.*/
  223. int frame_metrics_head;
  224. /*The frame count of each type (keyframes, delta frames, and dup frames);
  225. 32 bits limits us to 2.268 years at 60 fps.*/
  226. ogg_uint32_t frames_total[3];
  227. /*The number of frames of each type yet to be processed.*/
  228. ogg_uint32_t frames_left[3];
  229. /*The sum of the scale values for each frame type.*/
  230. ogg_int64_t scale_sum[2];
  231. /*The start of the window over which the current scale sums are taken.*/
  232. int scale_window0;
  233. /*The end of the window over which the current scale sums are taken.*/
  234. int scale_window_end;
  235. /*The frame count of each type in the current 2-pass window; this does not
  236. include dup frames.*/
  237. int nframes[3];
  238. /*The total accumulated estimation bias.*/
  239. ogg_int64_t rate_bias;
  240. };
  241. void oc_rc_state_init(oc_rc_state *_rc,oc_enc_ctx *_enc);
  242. void oc_rc_state_clear(oc_rc_state *_rc);
  243. void oc_enc_rc_resize(oc_enc_ctx *_enc);
  244. int oc_enc_select_qi(oc_enc_ctx *_enc,int _qti,int _clamp);
  245. void oc_enc_calc_lambda(oc_enc_ctx *_enc,int _frame_type);
  246. int oc_enc_update_rc_state(oc_enc_ctx *_enc,
  247. long _bits,int _qti,int _qi,int _trial,int _droppable);
  248. int oc_enc_rc_2pass_out(oc_enc_ctx *_enc,unsigned char **_buf);
  249. int oc_enc_rc_2pass_in(oc_enc_ctx *_enc,unsigned char *_buf,size_t _bytes);
  250. /*The internal encoder state.*/
  251. struct th_enc_ctx{
  252. /*Shared encoder/decoder state.*/
  253. oc_theora_state state;
  254. /*Buffer in which to assemble packets.*/
  255. oggpack_buffer opb;
  256. /*Encoder-specific macroblock information.*/
  257. oc_mb_enc_info *mb_info;
  258. /*DC coefficients after prediction.*/
  259. ogg_int16_t *frag_dc;
  260. /*The list of coded macro blocks, in coded order.*/
  261. unsigned *coded_mbis;
  262. /*The number of coded macro blocks.*/
  263. size_t ncoded_mbis;
  264. /*Whether or not packets are ready to be emitted.
  265. This takes on negative values while there are remaining header packets to
  266. be emitted, reaches 0 when the codec is ready for input, and becomes
  267. positive when a frame has been processed and data packets are ready.*/
  268. int packet_state;
  269. /*The maximum distance between keyframes.*/
  270. ogg_uint32_t keyframe_frequency_force;
  271. /*The number of duplicates to produce for the next frame.*/
  272. ogg_uint32_t dup_count;
  273. /*The number of duplicates remaining to be emitted for the current frame.*/
  274. ogg_uint32_t nqueued_dups;
  275. /*The number of duplicates emitted for the last frame.*/
  276. ogg_uint32_t prev_dup_count;
  277. /*The current speed level.*/
  278. int sp_level;
  279. /*Whether or not VP3 compatibility mode has been enabled.*/
  280. unsigned char vp3_compatible;
  281. /*Whether or not any INTER frames have been coded.*/
  282. unsigned char coded_inter_frame;
  283. /*Whether or not previous frame was dropped.*/
  284. unsigned char prevframe_dropped;
  285. /*Stores most recently chosen Huffman tables for each frame type, DC and AC
  286. coefficients, and luma and chroma tokens.
  287. The actual Huffman table used for a given coefficient depends not only on
  288. the choice made here, but also its index in the zig-zag ordering.*/
  289. unsigned char huff_idxs[2][2][2];
  290. /*Current count of bits used by each MV coding mode.*/
  291. size_t mv_bits[2];
  292. /*The mode scheme chooser for estimating mode coding costs.*/
  293. oc_mode_scheme_chooser chooser;
  294. /*The number of vertical super blocks in an MCU.*/
  295. int mcu_nvsbs;
  296. /*The SSD error for skipping each fragment in the current MCU.*/
  297. unsigned *mcu_skip_ssd;
  298. /*The DCT token lists for each coefficient and each plane.*/
  299. unsigned char **dct_tokens[3];
  300. /*The extra bits associated with each DCT token.*/
  301. ogg_uint16_t **extra_bits[3];
  302. /*The number of DCT tokens for each coefficient for each plane.*/
  303. ptrdiff_t ndct_tokens[3][64];
  304. /*Pending EOB runs for each coefficient for each plane.*/
  305. ogg_uint16_t eob_run[3][64];
  306. /*The offset of the first DCT token for each coefficient for each plane.*/
  307. unsigned char dct_token_offs[3][64];
  308. /*The last DC coefficient for each plane and reference frame.*/
  309. int dc_pred_last[3][3];
  310. #if defined(OC_COLLECT_METRICS)
  311. /*Fragment SATD statistics for MB mode estimation metrics.*/
  312. unsigned *frag_satd;
  313. /*Fragment SSD statistics for MB mode estimation metrics.*/
  314. unsigned *frag_ssd;
  315. #endif
  316. /*The R-D optimization parameter.*/
  317. int lambda;
  318. /*The huffman tables in use.*/
  319. th_huff_code huff_codes[TH_NHUFFMAN_TABLES][TH_NDCT_TOKENS];
  320. /*The quantization parameters in use.*/
  321. th_quant_info qinfo;
  322. oc_iquant *enquant_tables[64][3][2];
  323. oc_iquant_table enquant_table_data[64][3][2];
  324. /*An "average" quantizer for each quantizer type (INTRA or INTER) and qi
  325. value.
  326. This is used to paramterize the rate control decisions.
  327. They are kept in the log domain to simplify later processing.
  328. Keep in mind these are DCT domain quantizers, and so are scaled by an
  329. additional factor of 4 from the pixel domain.*/
  330. ogg_int64_t log_qavg[2][64];
  331. /*The buffer state used to drive rate control.*/
  332. oc_rc_state rc;
  333. /*Table for encoder acceleration functions.*/
  334. oc_enc_opt_vtable opt_vtable;
  335. };
  336. void oc_enc_analyze_intra(oc_enc_ctx *_enc,int _recode);
  337. int oc_enc_analyze_inter(oc_enc_ctx *_enc,int _allow_keyframe,int _recode);
  338. #if defined(OC_COLLECT_METRICS)
  339. void oc_enc_mode_metrics_collect(oc_enc_ctx *_enc);
  340. void oc_enc_mode_metrics_dump(oc_enc_ctx *_enc);
  341. #endif
  342. /*Perform fullpel motion search for a single MB against both reference frames.*/
  343. void oc_mcenc_search(oc_enc_ctx *_enc,int _mbi);
  344. /*Refine a MB MV for one frame.*/
  345. void oc_mcenc_refine1mv(oc_enc_ctx *_enc,int _mbi,int _frame);
  346. /*Refine the block MVs.*/
  347. void oc_mcenc_refine4mv(oc_enc_ctx *_enc,int _mbi);
  348. /*Used to rollback a tokenlog transaction when we retroactively decide to skip
  349. a fragment.
  350. A checkpoint is taken right before each token is added.*/
  351. struct oc_token_checkpoint{
  352. /*The color plane the token was added to.*/
  353. unsigned char pli;
  354. /*The zig-zag index the token was added to.*/
  355. unsigned char zzi;
  356. /*The outstanding EOB run count before the token was added.*/
  357. ogg_uint16_t eob_run;
  358. /*The token count before the token was added.*/
  359. ptrdiff_t ndct_tokens;
  360. };
  361. void oc_enc_tokenize_start(oc_enc_ctx *_enc);
  362. int oc_enc_tokenize_ac(oc_enc_ctx *_enc,int _pli,ptrdiff_t _fragi,
  363. ogg_int16_t *_qdct,const ogg_uint16_t *_dequant,const ogg_int16_t *_dct,
  364. int _zzi,oc_token_checkpoint **_stack,int _acmin);
  365. void oc_enc_tokenlog_rollback(oc_enc_ctx *_enc,
  366. const oc_token_checkpoint *_stack,int _n);
  367. void oc_enc_pred_dc_frag_rows(oc_enc_ctx *_enc,
  368. int _pli,int _fragy0,int _frag_yend);
  369. void oc_enc_tokenize_dc_frag_list(oc_enc_ctx *_enc,int _pli,
  370. const ptrdiff_t *_coded_fragis,ptrdiff_t _ncoded_fragis,
  371. int _prev_ndct_tokens1,int _prev_eob_run1);
  372. void oc_enc_tokenize_finish(oc_enc_ctx *_enc);
  373. /*Utility routine to encode one of the header packets.*/
  374. int oc_state_flushheader(oc_theora_state *_state,int *_packet_state,
  375. oggpack_buffer *_opb,const th_quant_info *_qinfo,
  376. const th_huff_code _codes[TH_NHUFFMAN_TABLES][TH_NDCT_TOKENS],
  377. const char *_vendor,th_comment *_tc,ogg_packet *_op);
  378. /*Encoder-specific accelerated functions.*/
  379. void oc_enc_frag_sub(const oc_enc_ctx *_enc,ogg_int16_t _diff[64],
  380. const unsigned char *_src,const unsigned char *_ref,int _ystride);
  381. void oc_enc_frag_sub_128(const oc_enc_ctx *_enc,ogg_int16_t _diff[64],
  382. const unsigned char *_src,int _ystride);
  383. unsigned oc_enc_frag_sad(const oc_enc_ctx *_enc,const unsigned char *_src,
  384. const unsigned char *_ref,int _ystride);
  385. unsigned oc_enc_frag_sad_thresh(const oc_enc_ctx *_enc,
  386. const unsigned char *_src,const unsigned char *_ref,int _ystride,
  387. unsigned _thresh);
  388. unsigned oc_enc_frag_sad2_thresh(const oc_enc_ctx *_enc,
  389. const unsigned char *_src,const unsigned char *_ref1,
  390. const unsigned char *_ref2,int _ystride,unsigned _thresh);
  391. unsigned oc_enc_frag_satd_thresh(const oc_enc_ctx *_enc,
  392. const unsigned char *_src,const unsigned char *_ref,int _ystride,
  393. unsigned _thresh);
  394. unsigned oc_enc_frag_satd2_thresh(const oc_enc_ctx *_enc,
  395. const unsigned char *_src,const unsigned char *_ref1,
  396. const unsigned char *_ref2,int _ystride,unsigned _thresh);
  397. unsigned oc_enc_frag_intra_satd(const oc_enc_ctx *_enc,
  398. const unsigned char *_src,int _ystride);
  399. void oc_enc_frag_copy2(const oc_enc_ctx *_enc,unsigned char *_dst,
  400. const unsigned char *_src1,const unsigned char *_src2,int _ystride);
  401. void oc_enc_frag_recon_intra(const oc_enc_ctx *_enc,
  402. unsigned char *_dst,int _ystride,const ogg_int16_t _residue[64]);
  403. void oc_enc_frag_recon_inter(const oc_enc_ctx *_enc,unsigned char *_dst,
  404. const unsigned char *_src,int _ystride,const ogg_int16_t _residue[64]);
  405. void oc_enc_fdct8x8(const oc_enc_ctx *_enc,ogg_int16_t _y[64],
  406. const ogg_int16_t _x[64]);
  407. /*Default pure-C implementations.*/
  408. void oc_enc_vtable_init_c(oc_enc_ctx *_enc);
  409. void oc_enc_frag_sub_c(ogg_int16_t _diff[64],
  410. const unsigned char *_src,const unsigned char *_ref,int _ystride);
  411. void oc_enc_frag_sub_128_c(ogg_int16_t _diff[64],
  412. const unsigned char *_src,int _ystride);
  413. void oc_enc_frag_copy2_c(unsigned char *_dst,
  414. const unsigned char *_src1,const unsigned char *_src2,int _ystride);
  415. unsigned oc_enc_frag_sad_c(const unsigned char *_src,
  416. const unsigned char *_ref,int _ystride);
  417. unsigned oc_enc_frag_sad_thresh_c(const unsigned char *_src,
  418. const unsigned char *_ref,int _ystride,unsigned _thresh);
  419. unsigned oc_enc_frag_sad2_thresh_c(const unsigned char *_src,
  420. const unsigned char *_ref1,const unsigned char *_ref2,int _ystride,
  421. unsigned _thresh);
  422. unsigned oc_enc_frag_satd_thresh_c(const unsigned char *_src,
  423. const unsigned char *_ref,int _ystride,unsigned _thresh);
  424. unsigned oc_enc_frag_satd2_thresh_c(const unsigned char *_src,
  425. const unsigned char *_ref1,const unsigned char *_ref2,int _ystride,
  426. unsigned _thresh);
  427. unsigned oc_enc_frag_intra_satd_c(const unsigned char *_src,int _ystride);
  428. void oc_enc_fdct8x8_c(ogg_int16_t _y[64],const ogg_int16_t _x[64]);
  429. #endif