Lines Matching defs:decoder

72     Decoder **decoder;
134 /* allocate memory for multiple decoder instances
136 decoder = (Decoder **)malloc(sizeof(Decoder*)*(u32)instCount);
137 if (decoder == NULL)
143 /* prepare each decoder instance */
146 decoder[i] = (Decoder *)calloc(1, sizeof(Decoder));
162 decoder[i]->byteStrmStart = (u8 *)malloc(sizeof(u8)*strmLen);
163 if (decoder[i]->byteStrmStart == NULL)
168 fread(decoder[i]->byteStrmStart, sizeof(u8), strmLen, finput);
175 decoder[i]->foutput = NULL;
177 sprintf(decoder[i]->outFileName, "%s%i", outFileName, i);
178 decoder[i]->foutput = fopen(decoder[i]->outFileName, "wb");
179 if (decoder[i]->foutput == NULL)
187 ret = H264SwDecInit(&(decoder[i]->decInst), disableOutputReordering);
195 decoder[i]->decInput.pStream = decoder[i]->byteStrmStart;
196 decoder[i]->decInput.dataLen = strmLen;
197 decoder[i]->decInput.intraConcealmentMethod = 0;
207 ret = H264SwDecDecode(decoder[i]->decInst,
208 &(decoder[i]->decInput),
209 &(decoder[i]->decOutput));
216 ret = H264SwDecGetInfo(decoder[i]->decInst,
217 &(decoder[i]->decInfo));
221 if (cropDisplay && decoder[i]->decInfo.croppingFlag)
225 decoder[i]->decInfo.cropParams.cropLeftOffset,
226 decoder[i]->decInfo.cropParams.cropTopOffset,
227 decoder[i]->decInfo.cropParams.cropOutWidth,
228 decoder[i]->decInfo.cropParams.cropOutHeight));
232 decoder[i]->decInfo.picWidth,
233 decoder[i]->decInfo.picHeight));
236 i, decoder[i]->decInfo.videoRange,
237 decoder[i]->decInfo.matrixCoefficients));
238 decoder[i]->decInput.dataLen -=
239 (u32)(decoder[i]->decOutput.pStrmCurrPos -
240 decoder[i]->decInput.pStream);
241 decoder[i]->decInput.pStream =
242 decoder[i]->decOutput.pStrmCurrPos;
246 decoder[i]->decInput.dataLen -=
247 (u32)(decoder[i]->decOutput.pStrmCurrPos -
248 decoder[i]->decInput.pStream);
249 decoder[i]->decInput.pStream =
250 decoder[i]->decOutput.pStrmCurrPos;
254 decoder[i]->decInput.dataLen = 0;
256 ret = H264SwDecGetInfo(decoder[i]->decInst,
257 &(decoder[i]->decInfo));
261 while (H264SwDecNextPicture(decoder[i]->decInst,
262 &(decoder[i]->decPicture), 0) == H264SWDEC_PIC_RDY)
264 decoder[i]->picNumber++;
266 numErrors += decoder[i]->decPicture.nbrOfErrMBs;
269 i, decoder[i]->picNumber,
270 decoder[i]->decPicture.isIdrPicture
272 decoder[i]->decPicture.nbrOfErrMBs));
275 CropWriteOutput(decoder[i]->foutput,
276 (u8*)decoder[i]->decPicture.pOutputPicture,
277 cropDisplay, &(decoder[i]->decInfo));
280 if (maxNumPics && decoder[i]->picNumber == maxNumPics)
281 decoder[i]->decInput.dataLen = 0;
287 decoder[i]->decInput.dataLen = 0;
302 if (decoder[i]->decInput.dataLen == 0)
312 while (H264SwDecNextPicture(decoder[i]->decInst,
313 &(decoder[i]->decPicture), 1) == H264SWDEC_PIC_RDY)
315 decoder[i]->picNumber++;
318 i, decoder[i]->picNumber,
319 decoder[i]->decPicture.isIdrPicture
321 decoder[i]->decPicture.nbrOfErrMBs));
324 CropWriteOutput(decoder[i]->foutput,
325 (u8*)decoder[i]->decPicture.pOutputPicture,
326 cropDisplay, &(decoder[i]->decInfo));
329 H264SwDecRelease(decoder[i]->decInst);
331 if (decoder[i]->foutput)
332 fclose(decoder[i]->foutput);
334 free(decoder[i]->byteStrmStart);
336 free(decoder[i]);
339 free(decoder);