static int Headers _ANSI_ARGS_((void));
static void Initialize_Sequence _ANSI_ARGS_((void));
static void Initialize_Decoder _ANSI_ARGS_((void));
+static void DeInitialize_Decoder _ANSI_ARGS_((void));
static void Deinitialize_Sequence _ANSI_ARGS_((void));
static void Process_Options _ANSI_ARGS_((int argc, char *argv[]));
/*close(enhan.Infile);*/
ld->close_stream(enhan.Infile);
+ DeInitialize_Decoder();
+
return ret;
}
#endif /*GDCM_BUILD_MPEG2DEC*/
}
+static void DeInitialize_Decoder()
+{
+ free(Clip-384); // WTF !!!
+}
+
/* mostly IMPLEMENTAION specific rouintes */
static void Initialize_Sequence()
{
{
int i;
+ /* First clenup the static buffer in store.c */
+ FreeStaticBuffer();
+
/* clear flags */
base.MPEG2_Flag=0;
static unsigned char obfr[OBFRSIZE];
static unsigned char *optr;
static ostream *outfile;
+unsigned char *static_malloc[6] = {0,0,0,0,0,0}; //worse case there is 6 buffer in this impl unit.
+
+void FreeStaticBuffer()
+{
+ int i;
+ for(i=0;i<6;++i)
+ free(static_malloc[i]);
+}
/*
* store a picture as either one frame or two fields
if (!(u422 = (unsigned char *)malloc((Coded_Picture_Width>>1)
*Coded_Picture_Height)))
Error("malloc failed");
+ static_malloc[0] = u422;
if (!(v422 = (unsigned char *)malloc((Coded_Picture_Width>>1)
*Coded_Picture_Height)))
Error("malloc failed");
+ static_malloc[1] = v422;
}
conv420to422(src[1],u422);
if (!(u422 = (unsigned char *)malloc((Coded_Picture_Width>>1)
*Coded_Picture_Height)))
Error("malloc failed");
+ static_malloc[2] = u422;
if (!(v422 = (unsigned char *)malloc((Coded_Picture_Width>>1)
*Coded_Picture_Height)))
Error("malloc failed");
+ static_malloc[3] = v422;
}
if (!(u444 = (unsigned char *)malloc(Coded_Picture_Width
*Coded_Picture_Height)))
Error("malloc failed");
+ static_malloc[4] = u444;
if (!(v444 = (unsigned char *)malloc(Coded_Picture_Width
*Coded_Picture_Height)))
Error("malloc failed");
+ static_malloc[5] = v444;
}
if (chroma_format==CHROMA420)