2 (c) Copyright 1998-2000 - Tord Jansson
3 ======================================
5 This file is part of the BladeEnc MP3 Encoder, based on
6 ISO's reference code for MPEG Layer 3 compression, and might
7 contain smaller or larger sections that are directly taken
8 from ISO's reference code.
10 All changes to the ISO reference code herein are either
11 copyrighted by Tord Jansson (tord.jansson@swipnet.se)
12 or sublicensed to Tord Jansson by a third party.
14 BladeEnc is free software; you can redistribute this file
15 and/or modify it under the terms of the GNU Lesser General Public
16 License as published by the Free Software Foundation; either
17 version 2.1 of the License, or (at your option) any later version.
21 ------------ Changes ------------
23 2000-11-22 Andre Piotrowski
25 - bug fix: mem_alloc() - no lomger a need to allocate block*2 bytes
28 /***********************************************************************
30 * Global Include Files
32 ***********************************************************************/
34 #include <string.h> /* 1995-07-11 shn */
44 /***********************************************************************
46 * Global Variable Definitions
48 ***********************************************************************/
50 /* 1: MPEG-1, 0: MPEG-2 LSF, 1995-07-11 shn */
57 /* 1: MPEG-1, 0: MPEG-2 LSF, 1995-07-11 shn */
60 { 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96,112,128,144,160},
61 { 0, 32, 40, 48, 56, 64, 80, 96,112,128,160,192,224,256,320}
68 /*******************************************************************************
70 * Allocate number of bytes of memory equal to "block".
72 *******************************************************************************/
74 void *mem_alloc (unsigned int block, char *item)
78 ptr = (void *) malloc (block);
80 memset (ptr, 0, block);
89 /****************************************************************************
91 * Free memory pointed to by "*ptr_addr".
93 *****************************************************************************/
95 void mem_free (void **ptr_addr)
97 if (*ptr_addr != NULL)