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.

90 lines
4.1KB

  1. /*
  2. * VC-1 and WMV3 decoder - DSP functions
  3. * Copyright (c) 2006 Konstantin Shishkov
  4. *
  5. * This file is part of Libav.
  6. *
  7. * Libav is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * Libav is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with Libav; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. /**
  22. * @file
  23. * VC-1 and WMV3 decoder
  24. */
  25. #ifndef AVCODEC_VC1DSP_H
  26. #define AVCODEC_VC1DSP_H
  27. #include "hpeldsp.h"
  28. #include "h264chroma.h"
  29. typedef struct VC1DSPContext {
  30. /* vc1 functions */
  31. void (*vc1_inv_trans_8x8)(int16_t *b);
  32. void (*vc1_inv_trans_8x4)(uint8_t *dest, ptrdiff_t stride, int16_t *block);
  33. void (*vc1_inv_trans_4x8)(uint8_t *dest, ptrdiff_t stride, int16_t *block);
  34. void (*vc1_inv_trans_4x4)(uint8_t *dest, ptrdiff_t stride, int16_t *block);
  35. void (*vc1_inv_trans_8x8_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block);
  36. void (*vc1_inv_trans_8x4_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block);
  37. void (*vc1_inv_trans_4x8_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block);
  38. void (*vc1_inv_trans_4x4_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block);
  39. void (*vc1_v_overlap)(uint8_t *src, int stride);
  40. void (*vc1_h_overlap)(uint8_t *src, int stride);
  41. void (*vc1_v_s_overlap)(int16_t *top, int16_t *bottom);
  42. void (*vc1_h_s_overlap)(int16_t *left, int16_t *right);
  43. void (*vc1_v_loop_filter4)(uint8_t *src, int stride, int pq);
  44. void (*vc1_h_loop_filter4)(uint8_t *src, int stride, int pq);
  45. void (*vc1_v_loop_filter8)(uint8_t *src, int stride, int pq);
  46. void (*vc1_h_loop_filter8)(uint8_t *src, int stride, int pq);
  47. void (*vc1_v_loop_filter16)(uint8_t *src, int stride, int pq);
  48. void (*vc1_h_loop_filter16)(uint8_t *src, int stride, int pq);
  49. /* put 8x8 block with bicubic interpolation and quarterpel precision
  50. * last argument is actually round value instead of height
  51. */
  52. op_pixels_func put_vc1_mspel_pixels_tab[16];
  53. op_pixels_func avg_vc1_mspel_pixels_tab[16];
  54. /* This is really one func used in VC-1 decoding */
  55. h264_chroma_mc_func put_no_rnd_vc1_chroma_pixels_tab[3];
  56. h264_chroma_mc_func avg_no_rnd_vc1_chroma_pixels_tab[3];
  57. /* Windows Media Image functions */
  58. void (*sprite_h)(uint8_t *dst, const uint8_t *src, int offset, int advance, int count);
  59. void (*sprite_v_single)(uint8_t *dst, const uint8_t *src1a, const uint8_t *src1b, int offset, int width);
  60. void (*sprite_v_double_noscale)(uint8_t *dst, const uint8_t *src1a, const uint8_t *src2a, int alpha, int width);
  61. void (*sprite_v_double_onescale)(uint8_t *dst, const uint8_t *src1a, const uint8_t *src1b, int offset1,
  62. const uint8_t *src2a, int alpha, int width);
  63. void (*sprite_v_double_twoscale)(uint8_t *dst, const uint8_t *src1a, const uint8_t *src1b, int offset1,
  64. const uint8_t *src2a, const uint8_t *src2b, int offset2,
  65. int alpha, int width);
  66. /**
  67. * Search buf from the start for up to size bytes. Return the index
  68. * of a zero byte, or >= size if not found. Ideally, use lookahead
  69. * to filter out any zero bytes that are known to not be followed by
  70. * one or more further zero bytes and a one byte.
  71. */
  72. int (*startcode_find_candidate)(const uint8_t *buf, int size);
  73. } VC1DSPContext;
  74. void ff_vc1dsp_init(VC1DSPContext* c);
  75. void ff_vc1dsp_init_aarch64(VC1DSPContext* dsp);
  76. void ff_vc1dsp_init_arm(VC1DSPContext* dsp);
  77. void ff_vc1dsp_init_ppc(VC1DSPContext *c);
  78. void ff_vc1dsp_init_x86(VC1DSPContext* dsp);
  79. #endif /* AVCODEC_VC1DSP_H */