Unverified Commit 0584c476 authored by janssontoftg's avatar janssontoftg
Browse files

Fix loop for ism_position packing. Remove duplicate of unpackPositions.

parent ffef6de5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -586,7 +586,7 @@ static ivas_error packISMPosition( const IVAS_PIDATA_GENERIC *piData, uint8_t *b

    buffer[nBytes++] = ( ism_position->piDataType & MASK_5BIT ); /* PF/PM populated during final packing */
    buffer[nBytes++] = (uint8_t) ism_position->numObjects * 6;
    for ( n = 0; n < piData->size / 6; n++ )
    for ( n = 0; n < ism_position->numObjects; n++ )
    {
        nBytes = writeInt16( buffer, nBytes, ivasPayload_convertToQ15( ism_position->position[n].x / MAX_PI_POSITION_METERS ) );
        nBytes = writeInt16( buffer, nBytes, ivasPayload_convertToQ15( ism_position->position[n].y / MAX_PI_POSITION_METERS ) );
+0 −12
Original line number Diff line number Diff line
@@ -1041,18 +1041,6 @@ def packISMDistanceAttenuation(bitstrm: BitStream, data: any):
        bitstrm.append(f'uint:6={roll_off_idx}')
        bitstrm.append(f'uint:6=0')     


def unpackPositions(bitstrm: ConstBitStream, piSize: int) -> list[POSITION]:
    assert piSize <= 24 and (piSize % 6) == 0, "Incorrect PI Data Size for Positions"
    positions = list()
    while piSize > 0:
        x = bitstrm.read(16).int / 100.0
        y = bitstrm.read(16).int / 100.0
        z = bitstrm.read(16).int / 100.0
        positions.append(POSITION(x, y, z))
        piSize -= 6
    return positions

def unpackISMDirectivity(bitstrm: ConstBitStream, piSize: int) -> list[DISTANCE_ATTENUATION]:
    inner_ang = None
    outer_ang = None