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

Simplify cache size calculation

parent b53ae61e
Loading
Loading
Loading
Loading
+2 −10
Original line number Diff line number Diff line
@@ -1384,9 +1384,6 @@ static ivas_error renderSplitBinauralWithPostRot(
    int8_t isPostRendInputCldfb;
    int16_t chnlIdx, slotIdx, smplIdx;
    int16_t preRendFrameSize_ms;
#ifdef SPLIT_REND_EXTEND_ISAR_FILE_HEADER
    int16_t preRendSubFrameFrameSize_ms;
#endif
    int16_t outBufNumSamplesPerChannel, outBufNumColPerChannel;
    int16_t numSamplesPerChannelCacheSize, numColPerChannelCacheSize;
    float *readPtr, *writePtr;
@@ -1463,12 +1460,7 @@ static ivas_error renderSplitBinauralWithPostRot(
                isPostRendInputCldfb = 1;
            }
#ifdef SPLIT_REND_EXTEND_ISAR_FILE_HEADER
            // TODO: does this need to be the local-renderer pcm framing or the bitstream framing?
            //  if pcm:  get from outAudio.config.numSamplesPerChannel/renderer.samplerate
            //  if bs: use isar_frame_size_ms or codec_frame_size_ms
            preRendSubFrameFrameSize_ms = 5;
            preRendFrameSize_ms = preRendSubFrameFrameSize_ms * num_subframes;
            numSamplesPerChannelCacheSize = (int16_t) ( *splitBinInput->base.ctx.pOutSampleRate * ( bits.isar_frame_size_ms - preRendSubFrameFrameSize_ms ) / 1000 );
            numSamplesPerChannelCacheSize = (int16_t) ( *splitBinInput->base.ctx.pOutSampleRate * bits.isar_frame_size_ms / 1000 ) - outBufNumSamplesPerChannel;
#else
            preRendFrameSize_ms = (int16_t) ( ivas_frame_duration_us ) / 1000;

@@ -1525,7 +1517,7 @@ static ivas_error renderSplitBinauralWithPostRot(
                            return error;
                        }

                        /* cache the remaining 15ms */
                        /* cache the remaining decoded audio */
                        splitBinInput->numCachedSamples = numSamplesPerChannelCacheSize;
                        mvr2r( &tmpCrendBuffer[0][outBufNumSamplesPerChannel], splitBinInput->bufferData, numSamplesPerChannelCacheSize );
                        mvr2r( &tmpCrendBuffer[1][outBufNumSamplesPerChannel], splitBinInput->bufferData + numSamplesPerChannelCacheSize, numSamplesPerChannelCacheSize );