style cleanup: avi

This commit is contained in:
2012-05-07 18:30:04 +00:00
parent a314b70930
commit e5faeab5d6
7 changed files with 774 additions and 753 deletions

View File

@@ -294,7 +294,8 @@ int AVI_is_avi(const char *name)
!GET_FCC(movie.fp) ||
GET_FCC(movie.fp) != FCC("strl") ||
(movie.streams[temp].sh.fcc = GET_FCC(movie.fp)) != FCC("strh") ||
!(movie.streams[temp].sh.size = GET_FCC (movie.fp))) {
!(movie.streams[temp].sh.size = GET_FCC(movie.fp)))
{
DEBUG_PRINT("bad stream header information\n");
MEM_freeN(movie.streams);
@@ -312,7 +313,8 @@ int AVI_is_avi(const char *name)
fcca == FCC("RGB ") ||
fcca == FCC("rgb ") ||
fcca == FCC("RAW ") ||
fcca == 0) {
fcca == 0)
{
movie.streams[temp].format = AVI_FORMAT_AVI_RGB;
}
else if (fcca == FCC("mjpg") || fcca == FCC("MJPG")) {
@@ -382,10 +384,13 @@ int AVI_is_avi(const char *name)
fcca == FCC("RGB ") ||
fcca == FCC("rgb ") ||
fcca == FCC("RAW ") ||
fcca == 0 ) {
fcca == 0)
{
/* pass */
}
else if (fcca == FCC("mjpg") ||
fcca == FCC ("MJPG")) {
fcca == FCC("MJPG"))
{
movie.streams[temp].format = AVI_FORMAT_MJPEG;
}
else {
@@ -452,7 +457,8 @@ AviError AVI_open_movie(const char *name, AviMovie *movie)
!GET_FCC(movie->fp) ||
GET_FCC(movie->fp) != FCC("hdrl") ||
(movie->header->fcc = GET_FCC(movie->fp)) != FCC("avih") ||
!(movie->header->size = GET_FCC (movie->fp))) {
!(movie->header->size = GET_FCC(movie->fp)))
{
DEBUG_PRINT("bad initial header info\n");
return AVI_ERROR_FORMAT;
}
@@ -487,7 +493,8 @@ AviError AVI_open_movie(const char *name, AviMovie *movie)
!GET_FCC(movie->fp) ||
GET_FCC(movie->fp) != FCC("strl") ||
(movie->streams[temp].sh.fcc = GET_FCC(movie->fp)) != FCC("strh") ||
!(movie->streams[temp].sh.size = GET_FCC (movie->fp))) {
!(movie->streams[temp].sh.size = GET_FCC(movie->fp)))
{
DEBUG_PRINT("bad stream header information\n");
return AVI_ERROR_FORMAT;
}
@@ -502,7 +509,8 @@ AviError AVI_open_movie(const char *name, AviMovie *movie)
fcca == FCC("RGB ") ||
fcca == FCC("rgb ") ||
fcca == FCC("RAW ") ||
fcca == 0) {
fcca == 0)
{
movie->streams[temp].format = AVI_FORMAT_AVI_RGB;
}
else if (fcca == FCC("mjpg") || fcca == FCC("MJPG")) {
@@ -563,15 +571,19 @@ AviError AVI_open_movie(const char *name, AviMovie *movie)
fcca = bi->Compression;
if (movie->streams[temp].format ==
AVI_FORMAT_AVI_RGB) {
AVI_FORMAT_AVI_RGB)
{
if (fcca == FCC("DIB ") ||
fcca == FCC("RGB ") ||
fcca == FCC("rgb ") ||
fcca == FCC("RAW ") ||
fcca == 0 ) {
fcca == 0)
{
/* pass */
}
else if (fcca == FCC("mjpg") ||
fcca == FCC ("MJPG")) {
fcca == FCC("MJPG"))
{
movie->streams[temp].format = AVI_FORMAT_MJPEG;
}
else {
@@ -681,7 +693,8 @@ void *AVI_read_frame (AviMovie *movie, AviFormat format, int frame, int stream)
while (cur_frame < frame && i < movie->index_entries) {
if (fcc_is_data(movie->entries[i].ChunkId) &&
fcc_get_stream (movie->entries[i].ChunkId) == stream) {
fcc_get_stream(movie->entries[i].ChunkId) == stream)
{
if ((cur_frame == frame - 1) && (movie->entries[i].Size == 0)) {
rewind = 1;
frame = frame - 1;
@@ -839,7 +852,7 @@ AviError AVI_open_compress(char *name, AviMovie *movie, int streams, ...)
((AviBitmapInfoHeader *) movie->streams[i].sf)->ClrUsed = 0;
((AviBitmapInfoHeader *) movie->streams[i].sf)->ClrImportant = 0;
/*
#if 0
if (movie->streams[i].format == AVI_FORMAT_MJPEG) {
AviMJPEGUnknown *tmp;
@@ -857,7 +870,7 @@ AviError AVI_open_compress(char *name, AviMovie *movie, int streams, ...)
else if (movie->streams[i].sh.Type == FCC("auds")) {
// pass
}
*/
#endif
}
}

View File

@@ -68,21 +68,26 @@ static void std_huff_tables (j_decompress_ptr dinfo)
{
static const UINT8 bits_dc_luminance[17] =
{ /* 0-base */
0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };
0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0
};
static const UINT8 val_dc_luminance[] =
{
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
};
static const UINT8 bits_dc_chrominance[17] =
{ /* 0-base */
0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };
0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0
};
static const UINT8 val_dc_chrominance[] =
{
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
};
static const UINT8 bits_ac_luminance[17] =
{ /* 0-base */
0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d };
0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d
};
static const UINT8 val_ac_luminance[] =
{
0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
@@ -105,10 +110,12 @@ static void std_huff_tables (j_decompress_ptr dinfo)
0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,
0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
0xf9, 0xfa };
0xf9, 0xfa
};
static const UINT8 bits_ac_chrominance[17] =
{ /* 0-base */
0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 };
0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77
};
static const UINT8 val_ac_chrominance[] =
{
0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,
@@ -131,7 +138,8 @@ static void std_huff_tables (j_decompress_ptr dinfo)
0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,
0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
0xf9, 0xfa };
0xf9, 0xfa
};
add_huff_table(dinfo, &dinfo->dc_huff_tbl_ptrs[0],
bits_dc_luminance, val_dc_luminance);