1
0

optim.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #pragma once
  2. typedef struct optimized_functions
  3. {
  4. //void (*itrans4x4)(const h264_short_macroblock_t tblock, const h264_imgpel_macroblock_t mb_pred, h264_imgpel_macroblock_t mb_rec, int pos_x, int pos_y);
  5. void (*itrans8x8)(h264_imgpel_macroblock_row_t *mb_rec, const h264_imgpel_macroblock_row_t *mb_pred, const h264_short_8x8block_row_t *block, int pos_x);
  6. void (*weighted_mc_prediction16x16)(h264_imgpel_macroblock_row_t *mb_pred, int wp_scale, int wp_offset, int weight_denom);
  7. void (*weighted_mc_prediction16x8)(h264_imgpel_macroblock_row_t *mb_pred, int wp_scale, int wp_offset, int weight_denom);
  8. void (*weighted_mc_prediction8x8)(h264_imgpel_macroblock_row_t *mb_pred, int wp_scale, int wp_offset, int weight_denom);
  9. void (*weighted_bi_prediction16x16)(h264_imgpel_macroblock_row_t *mb_pred, const h264_imgpel_macroblock_t block_l0, int wp_scale_l0, int wp_scale_l1, int wp_offset, int weight_denom);
  10. void (*weighted_bi_prediction16x8)(h264_imgpel_macroblock_row_t *mb_pred, const h264_imgpel_macroblock_t block_l0, int wp_scale_l0, int wp_scale_l1, int wp_offset, int weight_denom);
  11. void (*weighted_bi_prediction8x8)(h264_imgpel_macroblock_row_t *mb_pred, const h264_imgpel_macroblock_t block_l0, int wp_scale_l0, int wp_scale_l1, int wp_offset, int weight_denom);
  12. void (*bi_prediction8x8)(h264_imgpel_macroblock_row_t *mb_pred, const h264_imgpel_macroblock_t block_l0);
  13. void (*copy_image_data_16x16_stride)(struct video_image *destination, int dest_x, int dest_y, const h264_imgpel_macroblock_t source);
  14. int (*code_from_bitstream_2d_5_4)(SyntaxElement *sym, Bitstream *currStream, const uint8_t *lentab, const uint8_t *codtab, const uint8_t *masktab);
  15. int (*code_from_bitstream_2d_17_4)(SyntaxElement *sym, Bitstream *currStream, const uint16_t *lentab, const uint16_t *codtab, const uint16_t *masktab);
  16. int (*code_from_bitstream_2d_16_1)(Bitstream *currStream, const uint16_t *lentab, const uint16_t *codtab, const uint16_t *masktab);
  17. } OptimizedFunctions;
  18. extern OptimizedFunctions opt;
  19. /* define macros for these function calls. this way we could do specific builds that call the functions directly, if we have the need */
  20. #ifdef _DEBUG
  21. #define opt_itrans4x4 (itrans4x4_c)
  22. #else
  23. #define opt_itrans4x4 (itrans4x4_mmx)
  24. #endif
  25. #define opt_itrans8x8 (opt.itrans8x8)
  26. #define opt_weighted_mc_prediction16x16 (opt.weighted_mc_prediction16x16)
  27. #define opt_weighted_mc_prediction16x8 (opt.weighted_mc_prediction16x8)
  28. #define opt_weighted_mc_prediction8x8 (opt.weighted_mc_prediction8x8)
  29. #define opt_weighted_bi_prediction16x16 (opt.weighted_bi_prediction16x16)
  30. #define opt_weighted_bi_prediction16x8 (opt.weighted_bi_prediction16x8)
  31. #define opt_weighted_bi_prediction8x8 (opt.weighted_bi_prediction8x8)
  32. #define opt_bi_prediction8x8 (opt.bi_prediction8x8)
  33. #define opt_copy_image_data_16x16_stride (opt.copy_image_data_16x16_stride)
  34. #define opt_code_from_bitstream_2d_5_4 (opt.code_from_bitstream_2d_5_4)
  35. #define opt_code_from_bitstream_2d_17_4 (opt.code_from_bitstream_2d_17_4)
  36. #define opt_code_from_bitstream_2d_16_1 (opt.code_from_bitstream_2d_16_1)