H
Harry
Good Day,
I am writing a code for the H.264 Video codec.I am using VC++
compiler,but programming is in c only.I have grouped the related global
variables under one structure in a header file called global.h.Like
this i have two three structures in global.h.
To initialise the structure members in global.h,I declared structure
variables in c files wherever the structure members are used.
For example
This is one of the structure in global.h
typedef struct
{
int YUV;
int img_height;
int img_width;
int intra_period;
int IntraPeriod;//period of I-frames
int SPPicturePeriodicity; // SP-Picture Periodicity (0=not used)
int BReferencePictures; //Referenced B coded pictures (0=off, 1=on)
int start_frame_no_in_this_IGOP;
int BitDepthLuma;
int BitDepthChroma;
int InterSearch16x16;
int InterSearch16x8;
int InterSearch8x16;
int InterSearch8x8;
int InterSearch8x4;
int InterSearch4x8;
int InterSearch4x4;
int Transform8x8Mode;
int symbolMode;//Symbol mode (Entropy coding method: 0=UVLC, 1=CABAC)
int EnableIPCM;
int NoBframes;//no of b frames to be inserted
int UseHadamard;// Hadamard SymbolModeform (0=not used, 1=used)
int FrameSkip;//no of frames to be skipped
int RDopt;//2 means Fast High Complexity Mode\
}InputParameters;
In the above structure,for example if i want to initialize the
img_width,img_height variables with some value in a c file where it is
used,for example call it encoder.c,I have declared structure variable
like as
InputParameters inputs,*input=&inputs;
Now i can initialize the variable in any of the following ways
inputs.img_width=176; (or) input->img_width=176;
inputs.img_height=144; (or)input->img_height=144;
But i am getting the following error when i comile the c file,encoder.c
c:\documents and settings\hari\desktop\enocoder\encoder.c(4) : error
C2143: syntax error : missing '{' before '.'
c:\documents and settings\hari\desktop\enocoder\encoder.c(4) : error
C2059: syntax error : '.'
Can you suggest any other way for initailsing the structure member
variables direclty with some values.....
Thanks in advance
I am writing a code for the H.264 Video codec.I am using VC++
compiler,but programming is in c only.I have grouped the related global
variables under one structure in a header file called global.h.Like
this i have two three structures in global.h.
To initialise the structure members in global.h,I declared structure
variables in c files wherever the structure members are used.
For example
This is one of the structure in global.h
typedef struct
{
int YUV;
int img_height;
int img_width;
int intra_period;
int IntraPeriod;//period of I-frames
int SPPicturePeriodicity; // SP-Picture Periodicity (0=not used)
int BReferencePictures; //Referenced B coded pictures (0=off, 1=on)
int start_frame_no_in_this_IGOP;
int BitDepthLuma;
int BitDepthChroma;
int InterSearch16x16;
int InterSearch16x8;
int InterSearch8x16;
int InterSearch8x8;
int InterSearch8x4;
int InterSearch4x8;
int InterSearch4x4;
int Transform8x8Mode;
int symbolMode;//Symbol mode (Entropy coding method: 0=UVLC, 1=CABAC)
int EnableIPCM;
int NoBframes;//no of b frames to be inserted
int UseHadamard;// Hadamard SymbolModeform (0=not used, 1=used)
int FrameSkip;//no of frames to be skipped
int RDopt;//2 means Fast High Complexity Mode\
}InputParameters;
In the above structure,for example if i want to initialize the
img_width,img_height variables with some value in a c file where it is
used,for example call it encoder.c,I have declared structure variable
like as
InputParameters inputs,*input=&inputs;
Now i can initialize the variable in any of the following ways
inputs.img_width=176; (or) input->img_width=176;
inputs.img_height=144; (or)input->img_height=144;
But i am getting the following error when i comile the c file,encoder.c
c:\documents and settings\hari\desktop\enocoder\encoder.c(4) : error
C2143: syntax error : missing '{' before '.'
c:\documents and settings\hari\desktop\enocoder\encoder.c(4) : error
C2059: syntax error : '.'
Can you suggest any other way for initailsing the structure member
variables direclty with some values.....
Thanks in advance