Mercurial > mplayer.hg
annotate libvo/jpeg_enc.h @ 17075:884fc5e4cc86
Synced with 1.34
author | jheryan |
---|---|
date | Fri, 02 Dec 2005 14:34:04 +0000 |
parents | c9d1054aa359 |
children | cea0eb833758 |
rev | line source |
---|---|
4651
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
1 /* Straightforward (to be) optimized JPEG encoder for the YUV422 format |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
2 * based on mjpeg code from ffmpeg. |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
3 * |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
4 * Copyright (c) 2002, Rik Snel |
7902
c9d1054aa359
sync with libavcodec for unaccellerated dcts (sorry Felix, LIBAVCODEC_BUILD did not change, so also no backwards compatibility this time), and a long overdue copyright update
rik
parents:
4651
diff
changeset
|
5 * Parts from ffmpeg Copyright (c) 2000-2002 Fabrice Bellard |
4651
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
6 * |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
7 * This program is free software; you can redistribute it and/or modify |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
8 * it under the terms of the GNU General Public License as published by |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
9 * the Free Software Foundation; either version 2 of the License, or |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
10 * (at your option) any later version. |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
11 * |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
12 * This program is distributed in the hope that it will be useful, |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
15 * GNU General Public License for more details. |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
16 * |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
17 * You should have received a copy of the GNU General Public License |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
18 * along with this program; if not, write to the Free Software |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
20 * |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
21 * For an excellent introduction to the JPEG format, see: |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
22 * http://www.ece.purdue.edu/~bourman/grad-labs/lab8/pdf/lab.pdf |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
23 */ |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
24 |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
25 |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
26 typedef struct { |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
27 struct MpegEncContext *s; |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
28 int cheap_upsample; |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
29 int bw; |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
30 int y_ps; |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
31 int u_ps; |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
32 int v_ps; |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
33 int y_rs; |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
34 int u_rs; |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
35 int v_rs; |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
36 } jpeg_enc_t; |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
37 |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
38 jpeg_enc_t *jpeg_enc_init(int w, int h, int y_psize, int y_rsize, |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
39 int u_psize, int u_rsize, int v_psize, int v_rsize, |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
40 int cu, int q, int b); |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
41 |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
42 int jpeg_enc_frame(jpeg_enc_t *j, unsigned char *y_data, |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
43 unsigned char *u_data, unsigned char *v_data, char *bufr); |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
44 |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
45 void jpeg_enc_uninit(jpeg_enc_t *j); |