svq1enc.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * SVQ1 encoder
  3. *
  4. * This file is part of FFmpeg.
  5. *
  6. * FFmpeg is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * FFmpeg is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with FFmpeg; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. #ifndef AVCODEC_SVQ1ENC_H
  21. #define AVCODEC_SVQ1ENC_H
  22. #include <stdint.h>
  23. #include "libavutil/frame.h"
  24. #include "avcodec.h"
  25. #include "hpeldsp.h"
  26. #include "me_cmp.h"
  27. #include "mpegvideo.h"
  28. #include "put_bits.h"
  29. typedef struct SVQ1EncContext {
  30. /* FIXME: Needed for motion estimation, should not be used for anything
  31. * else, the idea is to make the motion estimation eventually independent
  32. * of MpegEncContext, so this will be removed then. */
  33. MpegEncContext m;
  34. AVCodecContext *avctx;
  35. MECmpContext mecc;
  36. HpelDSPContext hdsp;
  37. AVFrame *current_picture;
  38. AVFrame *last_picture;
  39. PutBitContext pb;
  40. /* Some compression statistics */
  41. enum AVPictureType pict_type;
  42. int quality;
  43. /* why ooh why this sick breadth first order,
  44. * everything is slower and more complex */
  45. PutBitContext reorder_pb[6];
  46. int frame_width;
  47. int frame_height;
  48. /* Y plane block dimensions */
  49. int y_block_width;
  50. int y_block_height;
  51. /* U & V plane (C planes) block dimensions */
  52. int c_block_width;
  53. int c_block_height;
  54. DECLARE_ALIGNED(16, int16_t, encoded_block_levels)[6][7][256];
  55. uint16_t *mb_type;
  56. uint32_t *dummy;
  57. int16_t (*motion_val8[3])[2];
  58. int16_t (*motion_val16[3])[2];
  59. int64_t rd_total;
  60. uint8_t *scratchbuf;
  61. int motion_est;
  62. int (*ssd_int8_vs_int16)(const int8_t *pix1, const int16_t *pix2,
  63. intptr_t size);
  64. } SVQ1EncContext;
  65. void ff_svq1enc_init_ppc(SVQ1EncContext *c);
  66. void ff_svq1enc_init_x86(SVQ1EncContext *c);
  67. #endif /* AVCODEC_SVQ1ENC_H */