1 /*
2  * straightforward (to be) optimized JPEG encoder for the YUV422 format
3  * based on MJPEG code from FFmpeg
4  *
5  * For an excellent introduction to the JPEG format, see:
6  * http://www.ece.purdue.edu/~bouman/grad-labs/lab8/pdf/lab.pdf
7  *
8  * Copyright (c) 2002, Rik Snel
9  * parts from FFmpeg Copyright (c) 2000-2002 Fabrice Bellard
10  *
11  * This file is part of MPlayer.
12  *
13  * MPlayer is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 2 of the License, or
16  * (at your option) any later version.
17  *
18  * MPlayer 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
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License along
24  * with MPlayer; if not, write to the Free Software Foundation, Inc.,
25  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26  */
27 
28 #ifndef MPLAYER_JPEG_ENC_H
29 #define MPLAYER_JPEG_ENC_H
30 
31 typedef struct {
32 	struct MpegEncContext *s;
33 	int cheap_upsample;
34 	int bw;
35 	int y_ps;
36 	int u_ps;
37 	int v_ps;
38 	int y_rs;
39 	int u_rs;
40 	int v_rs;
41 } jpeg_enc_t;
42 
43 jpeg_enc_t *jpeg_enc_init(int w, int h, int y_psize, int y_rsize,
44 		int u_psize, int u_rsize, int v_psize, int v_rsize,
45 		int cu, int q, int b);
46 
47 int jpeg_enc_frame(jpeg_enc_t *j, unsigned char *y_data,
48 		unsigned char *u_data, unsigned char *v_data, char *bufr);
49 
50 void jpeg_enc_uninit(jpeg_enc_t *j);
51 
52 #endif /* MPLAYER_JPEG_ENC_H */
53