Commit 7d0f9972 authored by sagnowski's avatar sagnowski
Browse files

Use strings instead of numbers for CODEC in renderer config files

parent 5b146951
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
BITRATE = 768000;
DOF = 1;
HQMODE = 0;
CODEC = 1;
CODEC = LC3PLUS;

[GENERAL]
RENDERER = CREND;
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
BITRATE = 768000;
DOF = 3;
HQMODE = 1;
CODEC = 1;
CODEC = LC3PLUS;

[GENERAL]
RENDERER = CREND;
+45 −4
Original line number Diff line number Diff line
@@ -371,6 +371,10 @@ ivas_error RenderConfigReader_read(
    char *pValue;
    int16_t nBandsInput;
    int16_t nVectorsMissing;
#ifdef SPLIT_REND_LC3PLUS
    bool dofProvided = false;
    bool poseCorrProvided = false;
#endif

    fseek( pRenderConfigReader->pConfigFile, 0, SEEK_END );
    file_size = ftell( pRenderConfigReader->pConfigFile );
@@ -517,20 +521,57 @@ ivas_error RenderConfigReader_read(
                    }
                    else if ( strcmp( item, "DOF" ) == 0 )
                    {
#ifdef SPLIT_REND_LC3PLUS
                        dofProvided = true;
#endif
                        if ( !sscanf( pValue, "%hd", &hRenderConfig->split_rend_config.dof ) )
                        {
                            errorHandler( item, ERROR_VALUE_INVALID );
                        }
#ifdef SPLIT_REND_LC3PLUS
                        /* 0 DOF implies no pose correction */
                        if ( hRenderConfig->split_rend_config.dof == 0 && !poseCorrProvided )
                        {
                            hRenderConfig->split_rend_config.poseCorrectionMode = IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE;
                        }
#endif
                    }
#ifdef SPLIT_REND_LC3PLUS
                    else if ( strcmp( item, "CODEC" ) == 0 )
                    {
                        int16_t tmp;
                        if ( !sscanf( pValue, "%hd", &tmp ) )
                        if ( strcmp( pValue, "LCLD" ) == 0 )
                        {
                            errorHandler( item, ERROR_VALUE_INVALID );
                            hRenderConfig->split_rend_config.codec = IVAS_SPLIT_REND_CODEC_LCLD;
                        }
                        else if ( strcmp( pValue, "LC3PLUS" ) == 0 )
                        {
                            hRenderConfig->split_rend_config.codec = IVAS_SPLIT_REND_CODEC_LC3PLUS;
                        }
                        else
                        {
                            errorHandler( pValue, ERROR_VALUE_INVALID );
                        }
                    }
                    else if ( strcmp( item, "POSECORRECTION" ) == 0 )
                    {
                        poseCorrProvided = true;
                        if ( strcmp( pValue, "CLDFB" ) == 0 )
                        {
                            hRenderConfig->split_rend_config.poseCorrectionMode = IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB;
                        }
                        else if ( strcmp( pValue, "NONE" ) == 0 )
                        {
                            hRenderConfig->split_rend_config.poseCorrectionMode = IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE;
                            /* no pose correction implies 0 DOF */
                            if ( !dofProvided )
                            {
                                hRenderConfig->split_rend_config.dof = 0;
                            }
                        }
                        else
                        {
                            errorHandler( pValue, ERROR_VALUE_INVALID );
                        }
                        hRenderConfig->split_rend_config.codec = tmp == 0 ? IVAS_SPLIT_REND_CODEC_LCLD : IVAS_SPLIT_REND_CODEC_LC3PLUS;
                    }
#endif

+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
BITRATE = 768000;
DOF = 1;
HQMODE = 0;
CODEC = 1;
CODEC = LC3PLUS;

[GENERAL]
RENDERER = CREND;