1 /*
2 * Sunplus JPEG decoder (SP5X)
3 * Copyright (c) 2003 Alex Beregszaszi
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 /**
23 * @file
24 * Sunplus JPEG decoder (SP5X).
25 */
26
31
32
34 void *
data,
int *got_frame,
36 {
38 int buf_size = avpkt->
size;
40 const int qscale = 5;
42 int i = 0, j = 0;
43
45 return -1;
46
48 if (!recoded)
49 return -1;
50
51 /* SOI */
52 recoded[j++] = 0xFF;
53 recoded[j++] = 0xD8;
54
59
62
67
70
72 for (i = 2; i < buf_size-2 && j < buf_size+1024-2; i++)
73 recoded[j++] = buf[i];
74 else
75 for (i = 14; i < buf_size && j < buf_size+1024-3; i++)
76 {
77 recoded[j++] = buf[i];
78 if (buf[i] == 0xff)
79 recoded[j++] = 0;
80 }
81
82 /* EOI */
83 recoded[j++] = 0xFF;
84 recoded[j++] = 0xD9;
85
87 avpkt_recoded.
data = recoded;
88 avpkt_recoded.
size = j;
90
92
93 return i < 0 ? i : avpkt->
size;
94 }
95
96 #if CONFIG_SP5X_DECODER
107 .max_lowres = 3,
108 };
109 #endif
110 #if CONFIG_AMV_DECODER
120 };
121 #endif