Commit 70147bab authored by TYAGIRIS's avatar TYAGIRIS
Browse files

missing renderer config changes

parent 4811ef2a
Loading
Loading
Loading
Loading
Loading
+144 −1
Original line number Diff line number Diff line
@@ -1069,7 +1069,11 @@ static void strip_spaces(

    while ( pStr[read_idx] )
    {
#ifdef SPLIT_REND_WITH_HEAD_ROT
        if ( !isspace( (int32_t) pStr[read_idx] ) && !iscntrl( (int32_t) pStr[read_idx] ) )
#else
        if ( !isspace( pStr[read_idx] ) && !iscntrl( pStr[read_idx] ) )
#endif
        {
            pStr[write_idx++] = pStr[read_idx];
        }
@@ -1833,6 +1837,10 @@ ivas_error RenderConfigReader_read(
    uint32_t fgHasMethod, fgHasNBands, fgHasFreqs, fgHasDefaultGrid, fgHasStartFreq, fgHasFreqHop;
    uint32_t aeHasFgIdx, aeHasPredelay, aeHasRt60, aeHasDsr;
    uint32_t aeHasERsize, aeHasERabs;
#ifdef SPLIT_REND_WITH_HEAD_ROT
    bool dofProvided = false;
    bool poseCorrProvided = false;
#endif

    uint32_t nDP;
    uint32_t accDPIdx;
@@ -2349,7 +2357,142 @@ ivas_error RenderConfigReader_read(
                free( pValue );
                acIdx++;
            }

#ifdef SPLIT_REND_WITH_HEAD_ROT
            else if ( strcmp( chapter, "SPLITREND" ) == 0 && strlen( pParams ) != 0 )
            {
                params_idx = 0;
                pValue = (char *) calloc( strlen( pParams ), sizeof( char ) );
                while ( sscanf( pParams + params_idx, "%64[^=]=%[^;];", item, pValue ) == 2 )
                {
                    params_idx += (int32_t) ( strlen( item ) + strlen( pValue ) + 2 );
#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG
                    fprintf( stderr, "        PARAM: %s -> %s\n", item, pValue );
#endif
                    if ( strcmp( item, "CODECDELAY" ) == 0 )
                    {
                        if ( !sscanf( pValue, "%hd", &hRenderConfig->split_rend_config.codec_delay_ms ) )
                        {
                            errorHandler( item, ERROR_VALUE_INVALID );
                        }
                    }
                    else if ( strcmp( item, "HQMODE" ) == 0 )
                    {
                        if ( !sscanf( pValue, "%hd", &hRenderConfig->split_rend_config.hq_mode ) )
                        {
                            errorHandler( item, ERROR_VALUE_INVALID );
                        }
                    }
                    else if ( strcmp( item, "BITRATE" ) == 0 )
                    {
                        if ( !sscanf( pValue, "%d", &hRenderConfig->split_rend_config.splitRendBitRate ) )
                        {
                            errorHandler( item, ERROR_VALUE_INVALID );
                        }
                    }
                    else if ( strcmp( item, "DOF" ) == 0 )
                    {
                        dofProvided = true;
                        if ( !sscanf( pValue, "%hd", &hRenderConfig->split_rend_config.dof ) )
                        {
                            errorHandler( item, ERROR_VALUE_INVALID );
                        }
                        /* 0 DOF implies no pose correction */
                        if ( hRenderConfig->split_rend_config.dof == 0 && !poseCorrProvided )
                        {
                            hRenderConfig->split_rend_config.poseCorrectionMode = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE;
                        }
                    }
                    else if ( strcmp( item, "CODEC" ) == 0 )
                    {
                        if ( strcmp( pValue, "LCLD" ) == 0 )
                        {
                            hRenderConfig->split_rend_config.codec = ISAR_SPLIT_REND_CODEC_LCLD;
                        }
                        else if ( strcmp( pValue, "LC3PLUS" ) == 0 )
                        {
                            hRenderConfig->split_rend_config.codec = ISAR_SPLIT_REND_CODEC_LC3PLUS;
                        }
                        else
                        {
                            errorHandler( pValue, ERROR_VALUE_INVALID );
                        }
                    }
                    else if ( strcmp( item, "FRAMESIZE" ) == 0 )
                    {
                        if ( !sscanf( pValue, "%hd", &hRenderConfig->split_rend_config.codec_frame_size_ms ) )
                        {
                            errorHandler( item, ERROR_VALUE_INVALID );
                        }
                        if ( hRenderConfig->split_rend_config.codec_frame_size_ms != 5 &&
                             hRenderConfig->split_rend_config.codec_frame_size_ms != 10 &&
                             hRenderConfig->split_rend_config.codec_frame_size_ms != 20 )
                        {
                            errorHandler( item, ERROR_VALUE_INVALID );
                        }
                    }
                    else if ( strcmp( item, "POSECORRECTION" ) == 0 )
                    {
                        poseCorrProvided = true;
                        if ( strcmp( pValue, "CLDFB" ) == 0 )
                        {
                            hRenderConfig->split_rend_config.poseCorrectionMode = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB;
                        }
                        else if ( strcmp( pValue, "NONE" ) == 0 )
                        {
                            hRenderConfig->split_rend_config.poseCorrectionMode = ISAR_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 );
                        }
                    }
                    else if ( strcmp( item, "RENDERER" ) == 0 )
                    {
                        if ( strcmp( pValue, "CREND" ) == 0 )
                        {
                            hRenderConfig->split_rend_config.rendererSelection = ISAR_SPLIT_REND_RENDERER_SELECTION_CREND;
                        }
                        else if ( strcmp( pValue, "FASTCONV" ) == 0 )
                        {
                            hRenderConfig->split_rend_config.rendererSelection = ISAR_SPLIT_REND_RENDERER_SELECTION_FASTCONV;
                        }
                        else if ( strcmp( pValue, "PARAMBIN" ) == 0 )
                        {
                            hRenderConfig->split_rend_config.rendererSelection = ISAR_SPLIT_REND_RENDERER_SELECTION_PARAMBIN;
                        }
                        else if ( strcmp( pValue, "TDREND" ) == 0 )
                        {
                            hRenderConfig->split_rend_config.rendererSelection = ISAR_SPLIT_REND_RENDERER_SELECTION_TDREND;
                        }
                        else
                        {
                            errorHandler( pValue, ERROR_VALUE_INVALID );
                        }
                    }
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
                    else if ( strcmp( item, "LC3PLUS_HIGHRES" ) == 0 )
                    {
                        if ( !sscanf( pValue, "%hd", &hRenderConfig->split_rend_config.lc3plus_highres ) )
                        {
                            errorHandler( item, ERROR_VALUE_INVALID );
                        }
                    }
#endif
#ifdef DEBUGGING
                    else
                    {
                        fprintf( stderr, "Unsupported configuration property %s\n", item );
                    }
#endif
                }
                free( pValue );
            }
#endif
            else if ( strcmp( chapter, "DIRECTIVITYSETTING" ) == 0 && strlen( pParams ) != 0 )
            {
                params_idx = 0;