www.pudn.com > avi 到 mpeg 的转换程序及源代码.zip > INITS.C
/*************************************************************************
* mplex - MPEG/SYSTEMS multiplexer *
* Copyright (C) 1994 1995 Christoph Moar *
* Siemens ZFE ST SN 11 / T SN 6 *
* *
* moar@informatik.tu-muenchen.de *
* (Christoph Moar) *
* klee@heaven.zfe.siemens.de *
* (Christian Kleegrewe, Siemens only requests) *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
*************************************************************************/
/*
* 4/4/97 - John Schlichther
*
* extensively altered to create avi2mpg1 - avi to mpeg-1 encoder
*
* Since avi file, and the avi subsystem are platform dependant, cross
* platform compatibility removed, many optional features disabled or
* removed, code generally trimmed to a minimum.
*
*/
#include "mplex.h"
/*************************************************************************
Initialisieren von Strukturen fuer S*N cc Compiler.
Initialize structs for S*N cc compiler.
*************************************************************************/
void empty_video_struc (pointer)
Video_struc *pointer;
{
int i;
pointer->stream_length = 0;
pointer->num_sequence = 0;
pointer->num_seq_end = 0;
pointer->num_pictures = 0;
pointer->num_groups = 0;
for (i=0; i<4; i++)
{
pointer->num_frames[i] = 0;
pointer->avg_frames[i] = 0;
}
pointer->horizontal_size = 0;
pointer->vertical_size = 0;
pointer->aspect_ratio = 0;
pointer->picture_rate = 0;
pointer->bit_rate = 0;
pointer->comp_bit_rate = 0;
pointer->vbv_buffer_size = 0;
pointer->CSPF = 0;
}
void empty_audio_struc (pointer)
Audio_struc *pointer;
{
int i;
pointer->stream_length = 0;
pointer->num_syncword = 0;
for (i=0; i<2; i++)
{
pointer->num_frames [i] = 0;
pointer->size_frames[i] = 0;
}
pointer->layer = 0;
pointer->protection = 0;
pointer->bit_rate = 0;
pointer->frequency = 0;
pointer->mode = 0;
pointer->mode_extension = 0;
pointer->copyright = 0;
pointer->original_copy = 0;
pointer->emphasis = 0;
}
void empty_vaunit_struc (pointer)
Vaunit_struc *pointer;
{
pointer->length = 0;
pointer->type = 0;
empty_timecode_struc (&pointer->DTS);
empty_timecode_struc (&pointer->PTS);
}
void empty_aaunit_struc (pointer)
Aaunit_struc *pointer;
{
pointer->length = 0;
empty_timecode_struc (&pointer->PTS);
}
void empty_sector_struc (pointer)
Sector_struc *pointer;
{
pointer->length_of_sector = 0;
pointer->length_of_packet_data = 0;
empty_timecode_struc (&pointer->TS);
}
void init_buffer_struc (pointer, size)
Buffer_struc *pointer;
unsigned int size;
{
pointer->max_size = size;
pointer->first = NULL;
}