aboutsummaryrefslogtreecommitdiff
path: root/Src/h264dec/lcommon/inc/memalloc.h
blob: fb4c313203aa1ee552d555dccb05c00b07a96925 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71

/*!
 ************************************************************************
 * \file  memalloc.h
 *
 * \brief
 *    Memory allocation and free helper funtions
 *
 * \author
 *    Main contributors (see contributors.h for copyright, address and affiliation details)
 *     - Karsten Sühring                 <suehring@hhi.de> 
 *     - Alexis Michael Tourapis         <alexismt@ieee.org> 
 *
 ************************************************************************
 */

#ifndef _MEMALLOC_H_
#define _MEMALLOC_H_

#include "global.h"
#include "quant_params.h"

#if defined(USEMMX) // && (IMGTYPE == 0) // MMX, SSE, SSE2 intrinsic support
#if defined(_MSC_VER) || defined(__INTEL_COMPILER) // ICC
#  include <emmintrin.h>
# else
#  include <xmmintrin.h>
# endif
#endif

extern int  get_mem2D(byte ***array2D, int dim0, int dim1);
extern int  get_mem3D(byte ****array3D, int dim0, int dim1, int dim2);
extern int  get_mem4D(byte *****array4D, int dim0, int dim1, int dim2, int dim3);

extern int  get_mem2Dint(int ***array2D, int rows, int columns);
extern int  get_mem3Dint(int ****array3D, int frames, int rows, int columns);
extern int  get_mem4Dint(int *****array4D, int idx, int frames, int rows, int columns );

extern int  get_mem2DPicMotion(struct pic_motion ***array3D, int rows, int columns);
extern int  get_mem3Dref(h264_ref_t ****array3D, int frames, int rows, int columns);

extern int  get_mem2Dshort(short ***array2D, int dim0, int dim1);
extern MotionVector ***get_mem3DMotionVector(int dim0, int dim1, int dim2);
extern int  get_mem4Dshort(short *****array4D, int dim0, int dim1, int dim2, int dim3);
extern int  get_mem2Dpel(imgpel ***array2D, int rows, int columns);

extern struct video_image *get_memImage(int width, int height);
extern void free_memImage(struct video_image *image);

extern void free_mem2D     (byte      **array2D);
extern void free_mem3D     (byte     ***array3D);
extern void free_mem4D     (byte    ****array4D);
//
extern void free_mem2Dint  (int       **array2D);
extern void free_mem3Dint  (int      ***array3D);

extern void free_mem3Dref(h264_ref_t    ***array3D);
extern void free_mem2DPicMotion(struct pic_motion    **array3D);
//
extern void free_mem2Dshort(short      **array2D);

extern void free_mem3DMotionVector(MotionVector ***);

extern void free_mem2Dpel  (imgpel    **array2D);
extern int init_top_bot_planes(imgpel **imgFrame, int height, imgpel ***imgTopField, imgpel ***imgBotField);
extern void free_top_bot_planes(imgpel **imgTopField, imgpel **imgBotField);

extern void no_mem_exit(char *where);


#endif