#include "al_sending.h"
#include "al_receiving.h"
#include "vid_sim.h"
Go to the source code of this file.
Classes | |
struct | video_codec |
Functions | |
video_codec * | new_video_codec (char *name) |
|
Definition at line 106 of file vid_wrapper.c. References video_codec::advanced, video_codec::B_image, video_codec::B_recon, video_codec::b_res, video_codec::bdist, video_codec::bframes, Bits, video_codec::bits, pict::BQUANT, video_codec::chosen_frameskip, config_vc(), video_codec::cpels, video_codec::curr_image, video_codec::curr_recon, DEF_FRAMESKIP, DEF_ORIG_SKIP, DEF_OUTFILENAME, DEF_UMV_MODE, video_codec::diff_filename, video_codec::done, video_codec::end, video_codec::first, video_codec::first_loop_finished, video_codec::frames, video_codec::headerlength, video_codec::icopies, init_idctref(), video_codec::input_file, video_codec::intra_bits, video_codec::label, video_codec::lines, video_codec::long_vectors, video_codec::mv_outside_frame, video_codec::no_coding, video_codec::orig_frameskip, video_codec::outputfile, pict::PB, video_codec::pb_frames, video_codec::pdist, video_codec::pels, video_codec::pframes, video_codec::pic, Pict, video_codec::PPFlag, video_codec::prev_image, video_codec::prev_recon, video_codec::QP, pict::QP_mean, video_codec::QPI, video_codec::ref_frame_rate, video_codec::res, Results, pict::seek_dist, video_codec::seqfilename, pict::source_format, video_codec::start, video_codec::streamname, video_codec::syntax_arith_coding, pict::target_frame_rate, video_codec::targetrate, video_codec::tmndecode, video_codec::total_bits, video_codec::total_frames_passed, video_codec::total_res, pict::TR, video_codec::trace, video_codec::tracefile, pict::unrestricted_mv_mode, pict::use_gobsync, VidSt, video_codec::wcopies, video_codec::write_repeated, and video_codec::writediff. Referenced by start_config(). 00112 : Ignoring OFFLINE_RATE_CONTROL stuff while I make changes. This will 00113 * probably break OFFLINE_RATE_CONTROL, but that doesn't matter because this 00114 * system is going to be used in an online matter only anyways. 00115 */ 00116 { 00117 video_codec *v; 00118 00119 v = malloc(sizeof(video_codec)); 00120 if (v != NULL) { 00121 00122 memset(v, 0, sizeof(video_codec)); 00123 00124 VidSt = v; 00125 00126 strcpy(v->label, name); 00127 v->done = 0; 00128 00129 00130 /* 00131 * Initialization stuff from vid_main.c 00132 */ 00133 00134 v->prev_image = NULL; 00135 v->curr_image = NULL; 00136 v->curr_recon = NULL; 00137 v->prev_recon = NULL; 00138 v->B_recon = NULL; 00139 v->B_image = NULL; 00140 v->pic = (Pict *)malloc(sizeof(Pict)); 00141 v->first_loop_finished=0; 00142 v->PPFlag = 0; 00143 v->pdist = 0; 00144 v->bdist = 0; 00145 v->bits = (Bits *)malloc(sizeof(Bits)); 00146 v->total_bits = (Bits *)malloc(sizeof(Bits)); 00147 v->intra_bits = (Bits *)malloc(sizeof(Bits)); 00148 v->res = (Results *)malloc(sizeof(Results)); 00149 v->total_res = (Results *)malloc(sizeof(Results)); 00150 v->b_res = (Results *)malloc(sizeof(Results)); 00151 /* v->seqfilename = (char *)malloc(sizeof(char)*100); */ 00152 v->streamname = (char *)malloc(sizeof(char)*100); 00153 v->outputfile = (char *)malloc(sizeof(char)*100); 00154 v->diff_filename=DEF_DIFFILENAME; 00155 v->tracefile = (char *)malloc(sizeof(char)*100); 00156 00157 00158 fprintf(stdout, "\nTMN (H.263) coder version 2.0, "); 00159 fprintf(stdout, "Copyright (C) 1995, 1996 Telenor R&D, Norway\n"); 00160 fprintf(stdout, "Heavy modification by Brendan Dowling based upon work by Feng Chen\n"); 00161 00162 v->headerlength = DEF_HEADERLENGTH; 00163 00164 #ifndef FASTIDCT 00165 init_idctref(); 00166 #endif 00167 00168 /* Default variable values */ 00169 v->advanced = DEF_ADV_MODE; 00170 v->syntax_arith_coding = DEF_SAC_MODE; 00171 v->pic->unrestricted_mv_mode = DEF_UMV_MODE; 00172 v->mv_outside_frame = DEF_UMV_MODE || DEF_ADV_MODE; 00173 v->long_vectors = DEF_UMV_MODE; 00174 v->pb_frames = DEF_PBF_MODE; 00175 00176 v->QP = DEF_INTER_QUANT; 00177 v->QPI = DEF_INTRA_QUANT; 00178 v->pic->BQUANT = DEF_BQUANT; 00179 v->pic->source_format = DEF_CODING_FORMAT; 00180 00181 v->ref_frame_rate = (float)DEF_REF_FRAME_RATE; 00182 v->chosen_frameskip = DEF_FRAMESKIP + 1; 00183 v->orig_frameskip = DEF_ORIG_SKIP + 1; 00184 00185 v->pic->target_frame_rate = (float)DEF_TARGET_FRAME_RATE; 00186 00187 /* v->seqfilename[0] = '\0'; */ 00188 v->seqfilename = v->input_file; 00189 /*strcpy(v->streamname, DEF_STREAMNAME);*/ 00190 strcpy(v->outputfile, DEF_OUTFILENAME); 00191 00192 v->writediff = DEF_WRITE_DIFF; 00193 v->trace = DEF_WRITE_TRACE; 00194 v->write_repeated = DEF_WRITE_REPEATED; 00195 v->pic->seek_dist = DEF_SEEK_DIST; 00196 v->pic->use_gobsync = DEF_INSERT_SYNC; 00197 v->start = DEF_START_FRAME; 00198 v->end = DEF_STOP_FRAME; 00199 00200 v->targetrate = 0; 00201 /* default is variable bit rate (fixed quantizer) will be used */ 00202 00203 v->frames = 0; 00204 v->pframes = 0; 00205 v->bframes = 0; 00206 v->total_frames_passed = 0; 00207 v->pic->PB = 0; 00208 v->wcopies = v->icopies = 1; 00209 00210 v->pic->TR = 0; 00211 v->pic->QP_mean = (float)0.0; 00212 00213 00214 switch (v->pic->source_format) { 00215 case (SF_SQCIF): 00216 fprintf(stdout, "Encoding format: SQCIF (128x96)\n"); 00217 v->pels = 128; 00218 v->lines = 96; 00219 break; 00220 case (SF_QCIF): 00221 fprintf(stdout, "Encoding format: QCIF (176x144)\n"); 00222 v->pels = 176; 00223 v->lines = 144; 00224 break; 00225 case (SF_CIF): 00226 fprintf(stdout, "Encoding format: CIF (352x288)\n"); 00227 v->pels = 352; 00228 v->lines = 288; 00229 break; 00230 case (SF_4CIF): 00231 fprintf(stdout, "Encoding format: 4CIF (704x576)\n"); 00232 v->pels = 704; 00233 v->lines = 576; 00234 break; 00235 case (SF_16CIF): 00236 fprintf(stdout, "Encoding format: 16CIF (1408x1152)\n"); 00237 v->pels = 1408; 00238 v->lines = 1152; 00239 break; 00240 default: 00241 fprintf(stderr,"Illegal coding format\n"); 00242 exit(-1); 00243 } 00244 v->cpels = v->pels/2; 00245 00246 /* 00247 * Get options from user, since there is no command line. 00248 */ 00249 config_vc(v); 00250 00251 /* 00252 * Make it so that first call to code_video will make initial frame. 00253 */ 00254 v->first = 1; 00255 00256 v->tmndecode = 0; 00257 v->no_coding = 0; 00258 } 00259 return (v); 00260 }
|