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.

95 lines
2.3KB

  1. /*
  2. * Copyright (C) 2003 the ffmpeg project
  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. */
  21. #ifndef AVCODEC_ROQVIDEO_H
  22. #define AVCODEC_ROQVIDEO_H
  23. #include "avcodec.h"
  24. #include "dsputil.h"
  25. #include "random.h"
  26. typedef struct {
  27. unsigned char y[4];
  28. unsigned char u, v;
  29. } roq_cell;
  30. typedef struct {
  31. int idx[4];
  32. } roq_qcell;
  33. typedef struct {
  34. int d[2];
  35. } motion_vect;
  36. typedef struct RoqContext {
  37. AVCodecContext *avctx;
  38. DSPContext dsp;
  39. AVFrame frames[2];
  40. AVFrame *last_frame;
  41. AVFrame *current_frame;
  42. int first_frame;
  43. int y_stride;
  44. int c_stride;
  45. roq_cell cb2x2[256];
  46. roq_qcell cb4x4[256];
  47. unsigned char *buf;
  48. int size;
  49. int width, height;
  50. /* Encoder only data */
  51. AVRandomState randctx;
  52. uint64_t lambda;
  53. motion_vect *this_motion4;
  54. motion_vect *last_motion4;
  55. motion_vect *this_motion8;
  56. motion_vect *last_motion8;
  57. unsigned int framesSinceKeyframe;
  58. AVFrame *frame_to_enc;
  59. uint8_t *out_buf;
  60. } RoqContext;
  61. #define RoQ_INFO 0x1001
  62. #define RoQ_QUAD_CODEBOOK 0x1002
  63. #define RoQ_QUAD_VQ 0x1011
  64. #define RoQ_SOUND_MONO 0x1020
  65. #define RoQ_SOUND_STEREO 0x1021
  66. #define RoQ_ID_MOT 0x00
  67. #define RoQ_ID_FCC 0x01
  68. #define RoQ_ID_SLD 0x02
  69. #define RoQ_ID_CCC 0x03
  70. void ff_apply_vector_2x2(RoqContext *ri, int x, int y, roq_cell *cell);
  71. void ff_apply_vector_4x4(RoqContext *ri, int x, int y, roq_cell *cell);
  72. void ff_apply_motion_4x4(RoqContext *ri, int x, int y, int deltax, int deltay);
  73. void ff_apply_motion_8x8(RoqContext *ri, int x, int y, int deltax, int deltay);
  74. #endif // AVCODEC_ROQVIDEO_H