Mercurial > libavcodec.hg
comparison mpegvideo.h @ 4150:2205aefb22b7 libavcodec
move AVCodecParser prototypes and definitions to parser.h, and move mpegvideo parser to mpeg12.c
author | bcoudurier |
---|---|
date | Mon, 06 Nov 2006 10:43:49 +0000 |
parents | db808f95ad06 |
children | 0f28fc219799 |
comparison
equal
deleted
inserted
replaced
4149:3118e8afb8a5 | 4150:2205aefb22b7 |
---|---|
29 #define AVCODEC_MPEGVIDEO_H | 29 #define AVCODEC_MPEGVIDEO_H |
30 | 30 |
31 #include "dsputil.h" | 31 #include "dsputil.h" |
32 #include "bitstream.h" | 32 #include "bitstream.h" |
33 #include "ratecontrol.h" | 33 #include "ratecontrol.h" |
34 #include "parser.h" | |
34 | 35 |
35 #define FRAME_SKIPPED 100 ///< return value for header parsers if frame is not coded | 36 #define FRAME_SKIPPED 100 ///< return value for header parsers if frame is not coded |
36 | 37 |
37 enum OutputFormat { | 38 enum OutputFormat { |
38 FMT_MPEG1, | 39 FMT_MPEG1, |
139 uint16_t *mc_mb_var; ///< Table for motion compensated MB variances | 140 uint16_t *mc_mb_var; ///< Table for motion compensated MB variances |
140 uint8_t *mb_mean; ///< Table for MB luminance | 141 uint8_t *mb_mean; ///< Table for MB luminance |
141 int32_t *mb_cmp_score; ///< Table for MB cmp scores, for mb decision FIXME remove | 142 int32_t *mb_cmp_score; ///< Table for MB cmp scores, for mb decision FIXME remove |
142 int b_frame_score; /* */ | 143 int b_frame_score; /* */ |
143 } Picture; | 144 } Picture; |
144 | |
145 typedef struct ParseContext{ | |
146 uint8_t *buffer; | |
147 int index; | |
148 int last_index; | |
149 unsigned int buffer_size; | |
150 uint32_t state; ///< contains the last few bytes in MSB order | |
151 int frame_start_found; | |
152 int overread; ///< the number of bytes which where irreversibly read from the next frame | |
153 int overread_index; ///< the index into ParseContext.buffer of the overreaded bytes | |
154 } ParseContext; | |
155 | 145 |
156 struct MpegEncContext; | 146 struct MpegEncContext; |
157 | 147 |
158 /** | 148 /** |
159 * Motion estimation context. | 149 * Motion estimation context. |
715 void ff_clean_intra_table_entries(MpegEncContext *s); | 705 void ff_clean_intra_table_entries(MpegEncContext *s); |
716 void ff_init_scantable(uint8_t *, ScanTable *st, const uint8_t *src_scantable); | 706 void ff_init_scantable(uint8_t *, ScanTable *st, const uint8_t *src_scantable); |
717 void ff_draw_horiz_band(MpegEncContext *s, int y, int h); | 707 void ff_draw_horiz_band(MpegEncContext *s, int y, int h); |
718 void ff_emulated_edge_mc(uint8_t *buf, uint8_t *src, int linesize, int block_w, int block_h, | 708 void ff_emulated_edge_mc(uint8_t *buf, uint8_t *src, int linesize, int block_w, int block_h, |
719 int src_x, int src_y, int w, int h); | 709 int src_x, int src_y, int w, int h); |
720 #define END_NOT_FOUND -100 | |
721 int ff_combine_frame(ParseContext *pc, int next, uint8_t **buf, int *buf_size); | |
722 void ff_parse_close(AVCodecParserContext *s); | |
723 void ff_mpeg_flush(AVCodecContext *avctx); | 710 void ff_mpeg_flush(AVCodecContext *avctx); |
724 void ff_print_debug_info(MpegEncContext *s, AVFrame *pict); | 711 void ff_print_debug_info(MpegEncContext *s, AVFrame *pict); |
725 void ff_write_quant_matrix(PutBitContext *pb, uint16_t *matrix); | 712 void ff_write_quant_matrix(PutBitContext *pb, uint16_t *matrix); |
726 int ff_find_unused_picture(MpegEncContext *s, int shared); | 713 int ff_find_unused_picture(MpegEncContext *s, int shared); |
727 void ff_denoise_dct(MpegEncContext *s, DCTELEM *block); | 714 void ff_denoise_dct(MpegEncContext *s, DCTELEM *block); |
787 DCTELEM block[6][64], | 774 DCTELEM block[6][64], |
788 int motion_x, int motion_y); | 775 int motion_x, int motion_y); |
789 void ff_mpeg1_encode_init(MpegEncContext *s); | 776 void ff_mpeg1_encode_init(MpegEncContext *s); |
790 void ff_mpeg1_encode_slice_header(MpegEncContext *s); | 777 void ff_mpeg1_encode_slice_header(MpegEncContext *s); |
791 void ff_mpeg1_clean_buffers(MpegEncContext *s); | 778 void ff_mpeg1_clean_buffers(MpegEncContext *s); |
792 int ff_mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size); | |
793 | 779 |
794 | 780 |
795 /** RLTable. */ | 781 /** RLTable. */ |
796 typedef struct RLTable { | 782 typedef struct RLTable { |
797 int n; ///< number of entries of table_vlc minus 1 | 783 int n; ///< number of entries of table_vlc minus 1 |
894 int ff_h263_get_gob_height(MpegEncContext *s); | 880 int ff_h263_get_gob_height(MpegEncContext *s); |
895 void ff_mpeg4_init_direct_mv(MpegEncContext *s); | 881 void ff_mpeg4_init_direct_mv(MpegEncContext *s); |
896 int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my); | 882 int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my); |
897 int ff_h263_round_chroma(int x); | 883 int ff_h263_round_chroma(int x); |
898 void ff_h263_encode_motion(MpegEncContext * s, int val, int f_code); | 884 void ff_h263_encode_motion(MpegEncContext * s, int val, int f_code); |
899 int ff_mpeg4_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size); | |
900 | 885 |
901 | 886 |
902 /* rv10.c */ | 887 /* rv10.c */ |
903 void rv10_encode_picture_header(MpegEncContext *s, int picture_number); | 888 void rv10_encode_picture_header(MpegEncContext *s, int picture_number); |
904 int rv_decode_dc(MpegEncContext *s, int n); | 889 int rv_decode_dc(MpegEncContext *s, int n); |
934 DCTELEM block[6][64]); | 919 DCTELEM block[6][64]); |
935 void mjpeg_picture_header(MpegEncContext *s); | 920 void mjpeg_picture_header(MpegEncContext *s); |
936 void mjpeg_picture_trailer(MpegEncContext *s); | 921 void mjpeg_picture_trailer(MpegEncContext *s); |
937 void ff_mjpeg_stuffing(PutBitContext * pbc); | 922 void ff_mjpeg_stuffing(PutBitContext * pbc); |
938 | 923 |
939 /* cavs.c */ | |
940 int ff_cavs_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size); | |
941 | |
942 #endif /* AVCODEC_MPEGVIDEO_H */ | 924 #endif /* AVCODEC_MPEGVIDEO_H */ |
943 | 925 |