This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

dm365 codecs missing default mpeg4 dynamic parameters?

Hi,

I've noticed that while all other encoders for dm365 (h264, jpeg) define default values for extended "DynamicParams" structs, mpeg4 encoder is missing it.

Ref:

dm365_codecs_01_00_06/packages/ti/sdo/codecs/h264enc/ih264venc.h defines:

 

/*
 * ===========================================================================
 * IH264VENC_DYNAMICPARAMS
 *
 * Default dynamic parameter values for h264enc instance object
 */

extern IH264VENC_DynamicParams H264VENC_TI_IH264VENC_DYNAMICPARAMS;

dm365_codecs_01_00_06/packages/ti/sdo/codecs/jpegenc/ijpegenc.h defines:
extern IJPEGENC_DynamicParams IJPEGENC_DYNAMICPARAMS;
The same thing seems to be missing for mpeg4 encoder.

 

  • Marco,

    Apologies for the delayed response.  I just checked my DVSDK 2.10.00.18 installation and do see the file

         ...dm365_codecs_01_00_06/packages/ti/sdo/codecs/mpeg4enc/imp4venc.h

    and this file does appear the have the analogous dynamic parameters data structure defined and extern...Are you missing this header file?  If so, I would recommend re-installing the dm365 codecs.

  • Juan,

    can you please check the name of the default structure? In my file there is only this:

    extern IMP4VENC_Params IMP4VENC_PARAMS;

    But this is the default for structure IMP4VENC_Params. Instead it is missing the default for IMP4VENC_DynamicParams. Notice that is is also defined after the definition of the dynamic parameters. I believe it is a typo.

    Here follows a cut&paste of the relevant part of the file:

     

     

        //

        // This structure defines the creation parameters for all MP4VE objects

        */

        typedef struct IMP4VENC_Params {


            IVIDENC1_Params videncParams; /* must be followed for all video encoders */


            // CreateParams specific to MPEG4 Encoder

            XDAS_Int32 subWindowHeight;     /* Height of the Subwindow       */

            XDAS_Int32 subWindowWidth;      /*  Width of the Subwindow     */

            XDAS_Int32 rotation;            /* Rotation (anticlockwise): 0: No Rotation, 90: 90 degree, 180: 180 degree, 270: 270 degree */

            /*Rate control related parameters*/

            XDAS_Int32 vbvSize;             /* VBV size interms of 16 K bits*/


            /*MPEG4/H.263(SVH) mode*/

            XDAS_Int32 svhMode;                 /* 1:Mpeg4 in short video header mode*/

        } IMP4VENC_Params;


        /*

        // ===========================================================================

        // IMP4VE_DynamicParams

        // This structure defines the parameters that can be modified run time

        */


        typedef struct IMP4VENC_DynamicParams

        {

            IVIDENC1_DynamicParams videncDynamicParams;


            XDAS_Int32 intraAlgo;           /* INTRA/INTER Decision Algorithm. 0: Algorithm 1 with IIDC at 16x16,

                                                                               1: Algorithm 1 with IIDC at 8x8,*/

            XDAS_Int32 numMBRows;           /* Number of MB rows in a Packet */


            /*Rate control related parameters*/

            XDAS_Int32 initQ;               /* Q init value */

            XDAS_Int32 rcQMax;             /* Q MAX value */

            XDAS_Int32 rcQMin;             /* Q MIN value */

            XDAS_Int32 intraFrameQP;               /* I-Frame QP value */

            XDAS_Int32 interFrameQP;               /* P-Frame QP value */

            XDAS_Int32 rateFix;             /* Reserved */

            XDAS_Int32 rateFixRange;        /* Reserved */


            /*Quality related parameters*/

            XDAS_Int32 meAlgo;              /* ME Algorithm. 0: 8421H ME, 1: 4421H ME, 2: 84221H ME, 3: 21H ME*/

            XDAS_Int32 skipMBAlgo;          /* SkipMB Algorithm. 0: normal skipMB Algo, 1: Bonus skipMB Algo */

            XDAS_Int32 unrestrictedMV;                 /* UMV. 0: disable, 1: enable*/


            /* parameter for Motion vector access*/

            XDAS_Int32 mvDataEnable;        /* for providing Motion vector access, 0: disable, 1: enable*/


        }IMP4VENC_DynamicParams;

        /*

         *  ======== IMP4VENC_PARAMS ========

         *  Default parameter values for MPEG4VENC instance objects

         */

        extern IMP4VENC_Params IMP4VENC_PARAMS;

  • Marcos,

    You are correct; the JPEGENC header file exters the param, dynamic param, and functions data structures, but the MPEG4ENC header file only appears to extern the param structure and not the other two.  However, I do believe I have ran MPEG4 encoding on DM365 before (will have to go back and double check), are you suggesting that MPEG4 is not working and that the difference in the header files may explain why?

  • There can be 2 problems here but I think that none can be the cause for a not working mpeg4 encoder. Beside this, I think mpeg4 works, the only but I've found in it is that there is no way to force generation of IDR frames instead of I-frames. The result is that stream configuration is not repeated after the first I-frame.

    But this is not the point I was trying to address. Pardon me if discussion will be long, the question is really not worth it but I want to explain that I think declaration and perhaps definition of a default value for dynamic encoder values is missing from the lib.

    Regarding the header file, there can be 2 cases, I'll explain with an example.

    Suppose a lib binary is compiled from a lib.c file:

    lib.c:

    int default=45;

    lib.h

    extern int default;

    Now, if the declaration of "default" is missing, then everything works, simply the programmer that whises to use the lib cannot not know that "default" is defined. It is simply a problem of declaration, not definition. I.e. "default" exists in the library, and it can still be used if it is declared as extern in the program linking the lib.

    Second case is if not only the extern declaration is missing, but also the definition is missing. In this case "default" simply does not exist and there is no way to "use" it.

    Back to our mpeg4, I can't know if the default is defined in the lib or not, but for sure the declaration is missing in the ".h" file. In both cases, I think it would be good to have it defined and declared. Both jpeg and h264 encoders have a similar data structure and the default value is correctly defined and declared.

    I've simply noticed that mpeg4 encoder misses a default. This means that programmer wishing to change a single parameter in the struct cannot copy the default values and the apply a single change.

     

  • Marco,

    Thank you for this valuable feedback.  I will pass this information on to our codec team to make sure it gets investigated and likely fixed.  I will post to this forum if I learn anything new on this topic.

  • Marco,

    FYI, most of the default parameters are found on the MPEG4 ENC User Guide; additionally, they are dfined at

    dm365_codecs_01_00_06\packages\ti\sdo\codecs\mpeg4enc\apps\Client\Test\TestVecs\Config\Testparams.cfg

    I know this still may not address the ability to get default paramaters and change one and pass data-structure back, but just an FYI.