1 /*
2 * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg 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 * FFmpeg 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 FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
25
26
28 uint8_t **poutbuf,
int *poutbuf_size,
29 const uint8_t *
buf,
int buf_size,
int keyframe){
30 uint32_t header, extraheader;
31 int mode_extension, header_size;
32
35 return -1;
36 }
37
39 mode_extension= (header>>4)&3;
40
42 output_unchanged:
44 *poutbuf_size= buf_size;
45
47 return 0;
48 }
49
55 }
58 return -1;
59 }
61 if((extraheader&
MP3_MASK) != (header&MP3_MASK))
62 goto output_unchanged;
63
64 header_size= (header&0x10000) ? 4 : 6;
65
66 *poutbuf_size= buf_size - header_size;
69
71 if((header & (3<<19)) != 3<<19){
72 (*poutbuf)[1] &= 0x3F;
73 (*poutbuf)[1] |= mode_extension<<6;
74 FFSWAP(
int, (*poutbuf)[1], (*poutbuf)[2]);
75 }else{
76 (*poutbuf)[1] &= 0x8F;
77 (*poutbuf)[1] |= mode_extension<<4;
78 }
79 }
80
81 return 1;
82 }
83
85 "mp3comp",
86 0,
88 };