]> git.sesse.net Git - ffmpeg/blob - libavcodec/svq1enc.h
lavc: add Intel libmfx-based MPEG2 decoder.
[ffmpeg] / libavcodec / svq1enc.h
1 /*
2  * SVQ1 encoder
3  *
4  * This file is part of Libav.
5  *
6  * Libav 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  * Libav 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 Libav; 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_SVQ1ENC_H
22 #define AVCODEC_SVQ1ENC_H
23
24 #include <stdint.h>
25
26 #include "libavutil/frame.h"
27 #include "avcodec.h"
28 #include "get_bits.h"
29 #include "hpeldsp.h"
30 #include "me_cmp.h"
31 #include "mpegvideo.h"
32 #include "put_bits.h"
33
34 typedef struct SVQ1EncContext {
35     /* FIXME: Needed for motion estimation, should not be used for anything
36      * else, the idea is to make the motion estimation eventually independent
37      * of MpegEncContext, so this will be removed then. */
38     MpegEncContext m;
39     AVCodecContext *avctx;
40     MECmpContext mecc;
41     HpelDSPContext hdsp;
42     AVFrame *current_picture;
43     AVFrame *last_picture;
44     PutBitContext pb;
45     GetBitContext gb;
46
47     /* Some compression statistics */
48     enum AVPictureType pict_type;
49     int quality;
50
51     /* why ooh why this sick breadth first order,
52      * everything is slower and more complex */
53     PutBitContext reorder_pb[6];
54
55     int frame_width;
56     int frame_height;
57
58     /* Y plane block dimensions */
59     int y_block_width;
60     int y_block_height;
61
62     /* U & V plane (C planes) block dimensions */
63     int c_block_width;
64     int c_block_height;
65
66     uint16_t *mb_type;
67     uint32_t *dummy;
68     int16_t (*motion_val8[3])[2];
69     int16_t (*motion_val16[3])[2];
70
71     int64_t rd_total;
72
73     uint8_t *scratchbuf;
74
75     int (*ssd_int8_vs_int16)(const int8_t *pix1, const int16_t *pix2,
76                              int size);
77 } SVQ1EncContext;
78
79 void ff_svq1enc_init_ppc(SVQ1EncContext *c);
80 void ff_svq1enc_init_x86(SVQ1EncContext *c);
81
82 #endif /* AVCODEC_SVQ1ENC_H */