2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
19 * All rights reserved.
21 * The Original Code is: all of this file.
23 * Contributor(s): none yet.
25 * ***** END GPL LICENSE BLOCK *****
28 /** \file blender/avi/intern/avi_codecs.c
31 * This is external code. Identify and convert different avi-files.
36 #include "avi_intern.h"
39 #include "avi_mjpeg.h"
40 #include "avi_rgb32.h"
42 void *avi_format_convert(AviMovie *movie, int stream, void *buffer, AviFormat from, AviFormat to, int *size)
47 if (from != AVI_FORMAT_RGB24 &&
48 to != AVI_FORMAT_RGB24)
50 return avi_format_convert(movie, stream,
51 avi_format_convert(movie, stream, buffer, from, AVI_FORMAT_RGB24, size),
52 AVI_FORMAT_RGB24, to, size);
56 case AVI_FORMAT_RGB24:
58 case AVI_FORMAT_AVI_RGB:
59 buffer = avi_converter_from_avi_rgb(movie, stream, buffer, size);
61 case AVI_FORMAT_MJPEG:
62 buffer = avi_converter_from_mjpeg(movie, stream, buffer, size);
64 case AVI_FORMAT_RGB32:
65 buffer = avi_converter_from_rgb32(movie, stream, buffer, size);
71 case AVI_FORMAT_AVI_RGB:
72 buffer = avi_converter_to_avi_rgb(movie, stream, buffer, size);
74 case AVI_FORMAT_MJPEG:
75 buffer = avi_converter_to_mjpeg(movie, stream, buffer, size);
77 case AVI_FORMAT_RGB32:
78 buffer = avi_converter_to_rgb32(movie, stream, buffer, size);
87 int avi_get_data_id(AviFormat format, int stream)
91 if (avi_get_format_type(format) == FCC("vids"))
92 sprintf(fcc, "%2.2ddc", stream);
93 else if (avi_get_format_type(format) == FCC("auds"))
94 sprintf(fcc, "%2.2ddc", stream);
101 int avi_get_format_type(AviFormat format)
104 case AVI_FORMAT_RGB24:
105 case AVI_FORMAT_RGB32:
106 case AVI_FORMAT_AVI_RGB:
107 case AVI_FORMAT_MJPEG:
114 int avi_get_format_fcc(AviFormat format)
117 case AVI_FORMAT_RGB24:
118 case AVI_FORMAT_RGB32:
119 case AVI_FORMAT_AVI_RGB:
121 case AVI_FORMAT_MJPEG:
128 int avi_get_format_compression(AviFormat format)
131 case AVI_FORMAT_RGB24:
132 case AVI_FORMAT_RGB32:
133 case AVI_FORMAT_AVI_RGB:
135 case AVI_FORMAT_MJPEG: