diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2016-03-27 01:38:28 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2016-03-27 01:38:28 +0000 |
commit | 367c9cb514c9da766488b9bdb218a18e31cb7624 (patch) | |
tree | f9e343be94161a4837f0f1c1d072a35538ae0f63 /converter/ppm/ppmtompeg/frames.c | |
parent | 6e88e3326cb0c7f7975b56189278cab3f84ba1bd (diff) | |
download | netpbm-mirror-367c9cb514c9da766488b9bdb218a18e31cb7624.tar.gz netpbm-mirror-367c9cb514c9da766488b9bdb218a18e31cb7624.tar.xz netpbm-mirror-367c9cb514c9da766488b9bdb218a18e31cb7624.zip |
Promote Stable (10.47) to Super Stable
git-svn-id: http://svn.code.sf.net/p/netpbm/code/super_stable@2691 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/ppm/ppmtompeg/frames.c')
-rw-r--r-- | converter/ppm/ppmtompeg/frames.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/converter/ppm/ppmtompeg/frames.c b/converter/ppm/ppmtompeg/frames.c new file mode 100644 index 00000000..a0764890 --- /dev/null +++ b/converter/ppm/ppmtompeg/frames.c @@ -0,0 +1,58 @@ +#include "mallocvar.h" +#include "fsize.h" + +#include "frames.h" + + +Block **dct=NULL, **dctr=NULL, **dctb=NULL; +dct_data_type **dct_data; /* used in p/bframe.c */ + + +/*===========================================================================* + * + * AllocDctBlocks + * + * allocate memory for dct blocks + * + * RETURNS: nothing + * + * SIDE EFFECTS: creates dct, dctr, dctb + * + *===========================================================================*/ +void +AllocDctBlocks(void) { + + int dctx, dcty; + int i; + + dctx = Fsize_x / DCTSIZE; + dcty = Fsize_y / DCTSIZE; + + MALLOCARRAY(dct, dcty); + ERRCHK(dct, "malloc"); + for (i = 0; i < dcty; ++i) { + dct[i] = (Block *) malloc(sizeof(Block) * dctx); + ERRCHK(dct[i], "malloc"); + } + + MALLOCARRAY(dct_data, dcty); + ERRCHK(dct_data, "malloc"); + for (i = 0; i < dcty; ++i) { + MALLOCARRAY(dct_data[i], dctx); + ERRCHK(dct[i], "malloc"); + } + + MALLOCARRAY(dctr, dcty/2); + ERRCHK(dctr, "malloc"); + MALLOCARRAY(dctb, dcty/2); + ERRCHK(dctb, "malloc"); + for (i = 0; i < dcty/2; ++i) { + MALLOCARRAY(dctr[i], dctx/2); + ERRCHK(dctr[i], "malloc"); + MALLOCARRAY(dctb[i], dctx/2); + ERRCHK(dctb[i], "malloc"); + } +} + + + |