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.

65 lines
2.0KB

  1. /*
  2. * MJPEG encoder
  3. * Copyright (c) 2000, 2001 Fabrice Bellard
  4. * Copyright (c) 2003 Alex Beregszaszi
  5. * Copyright (c) 2003-2004 Michael Niedermayer
  6. *
  7. * Support for external huffman table, various fixes (AVID workaround),
  8. * aspecting, new decode_frame mechanism and apple mjpeg-b support
  9. * by Alex Beregszaszi
  10. *
  11. * This file is part of Libav.
  12. *
  13. * Libav is free software; you can redistribute it and/or
  14. * modify it under the terms of the GNU Lesser General Public
  15. * License as published by the Free Software Foundation; either
  16. * version 2.1 of the License, or (at your option) any later version.
  17. *
  18. * Libav is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  21. * Lesser General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU Lesser General Public
  24. * License along with Libav; if not, write to the Free Software
  25. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  26. */
  27. /**
  28. * @file
  29. * MJPEG encoder.
  30. */
  31. #ifndef AVCODEC_MJPEGENC_H
  32. #define AVCODEC_MJPEGENC_H
  33. #include <stdint.h>
  34. #include "mjpeg.h"
  35. #include "mpegvideo.h"
  36. #include "put_bits.h"
  37. typedef struct MJpegContext {
  38. uint8_t huff_size_dc_luminance[12]; //FIXME use array [3] instead of lumi / chroma, for easier addressing
  39. uint16_t huff_code_dc_luminance[12];
  40. uint8_t huff_size_dc_chrominance[12];
  41. uint16_t huff_code_dc_chrominance[12];
  42. uint8_t huff_size_ac_luminance[256];
  43. uint16_t huff_code_ac_luminance[256];
  44. uint8_t huff_size_ac_chrominance[256];
  45. uint16_t huff_code_ac_chrominance[256];
  46. } MJpegContext;
  47. static inline void put_marker(PutBitContext *p, enum JpegMarker code)
  48. {
  49. put_bits(p, 8, 0xff);
  50. put_bits(p, 8, code);
  51. }
  52. int ff_mjpeg_encode_init(MpegEncContext *s);
  53. void ff_mjpeg_encode_close(MpegEncContext *s);
  54. void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[8][64]);
  55. #endif /* AVCODEC_MJPEGENC_H */