2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU General Public License
4 * as published by the Free Software Foundation; either version 2
5 * of the License, or (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software Foundation,
14 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17 * All rights reserved.
20 /** \file blender/avi/intern/avi_codecs.c
23 * This is external code. Identify and convert different avi-files.
28 #include "avi_intern.h"
31 #include "avi_mjpeg.h"
32 #include "avi_rgb32.h"
34 void *avi_format_convert(AviMovie *movie, int stream, void *buffer, AviFormat from, AviFormat to, size_t *size)
39 if (from != AVI_FORMAT_RGB24 &&
40 to != AVI_FORMAT_RGB24)
42 return avi_format_convert(movie, stream,
43 avi_format_convert(movie, stream, buffer, from, AVI_FORMAT_RGB24, size),
44 AVI_FORMAT_RGB24, to, size);
48 case AVI_FORMAT_RGB24:
50 case AVI_FORMAT_AVI_RGB:
51 buffer = avi_converter_from_avi_rgb(movie, stream, buffer, size);
53 case AVI_FORMAT_MJPEG:
54 buffer = avi_converter_from_mjpeg(movie, stream, buffer, size);
56 case AVI_FORMAT_RGB32:
57 buffer = avi_converter_from_rgb32(movie, stream, buffer, size);
63 case AVI_FORMAT_AVI_RGB:
64 buffer = avi_converter_to_avi_rgb(movie, stream, buffer, size);
66 case AVI_FORMAT_MJPEG:
67 buffer = avi_converter_to_mjpeg(movie, stream, buffer, size);
69 case AVI_FORMAT_RGB32:
70 buffer = avi_converter_to_rgb32(movie, stream, buffer, size);
79 int avi_get_data_id(AviFormat format, int stream)
83 if (avi_get_format_type(format) == FCC("vids"))
84 sprintf(fcc, "%2.2ddc", stream);
85 else if (avi_get_format_type(format) == FCC("auds"))
86 sprintf(fcc, "%2.2ddc", stream);
93 int avi_get_format_type(AviFormat format)
96 case AVI_FORMAT_RGB24:
97 case AVI_FORMAT_RGB32:
98 case AVI_FORMAT_AVI_RGB:
99 case AVI_FORMAT_MJPEG:
106 int avi_get_format_fcc(AviFormat format)
109 case AVI_FORMAT_RGB24:
110 case AVI_FORMAT_RGB32:
111 case AVI_FORMAT_AVI_RGB:
113 case AVI_FORMAT_MJPEG:
120 int avi_get_format_compression(AviFormat format)
123 case AVI_FORMAT_RGB24:
124 case AVI_FORMAT_RGB32:
125 case AVI_FORMAT_AVI_RGB:
127 case AVI_FORMAT_MJPEG: