Loading lib_util/ivas_rtp_pi_data.c +4 −4 Original line number Diff line number Diff line Loading @@ -767,7 +767,7 @@ static ivas_error packPositionCompact( const IVAS_PIDATA_GENERIC *piData, uint8_ static ivas_error unpackPositionCompact( const uint8_t *buffer, uint32_t numDataBytes, IVAS_PIDATA_GENERIC *piData ) { IVAS_PIDATA_POSITION *position = (IVAS_PIDATA_POSITION *) piData; int32_t compactRead = 0; uint32_t compactRead = 0; /* Compact position data is 4 bytes */ if ( numDataBytes != 4 ) Loading @@ -777,7 +777,7 @@ static ivas_error unpackPositionCompact( const uint8_t *buffer, uint32_t numData position->size = sizeof( IVAS_PIDATA_POSITION ); compactRead = ( (int32_t) buffer[0] << 24 ) | ( (int32_t) buffer[1] << 16 ) | ( (int32_t) buffer[2] << 8 ) | ( (int32_t) buffer[3] ); compactRead = ( (uint32_t) buffer[0] << 24 ) | ( (uint32_t) buffer[1] << 16 ) | ( (uint32_t) buffer[2] << 8 ) | ( (uint32_t) buffer[3] ); position->position.x = FLOAT_FROM_Q10( (int16_t) ( compactRead >> 21 ) ) * MAX_PI_COMPACT_POSITION_XY_METERS; /* Shift preserves sign bit */ compactRead = compactRead << 11; /* Discard read bits */ position->position.y = FLOAT_FROM_Q10( (int16_t) ( compactRead >> 21 ) ) * MAX_PI_COMPACT_POSITION_XY_METERS; /* Shift preserves sign bit */ Loading Loading @@ -893,7 +893,7 @@ static ivas_error packISMPositionCompact( const IVAS_PIDATA_GENERIC *piData, uin static ivas_error unpackISMPositionCompact( const uint8_t *buffer, uint32_t numDataBytes, IVAS_PIDATA_GENERIC *piData ) { uint16_t n; int32_t compactRead = 0; uint32_t compactRead = 0; IVAS_PIDATA_ISM_POSITION *ism_position = (IVAS_PIDATA_ISM_POSITION *) piData; /* Compact position data is 4 bytes */ Loading @@ -908,7 +908,7 @@ static ivas_error unpackISMPositionCompact( const uint8_t *buffer, uint32_t numD for ( n = 0; n < ism_position->numObjects; n++ ) { compactRead = ( (int32_t) buffer[n * 4] << 24 ) | ( (int32_t) buffer[n * 4 + 1] << 16 ) | ( (int32_t) buffer[n * 4 + 2] << 8 ) | ( (int32_t) buffer[n * 4 + 3] ); compactRead = ( (uint32_t) buffer[n * 4] << 24 ) | ( (uint32_t) buffer[n * 4 + 1] << 16 ) | ( (uint32_t) buffer[n * 4 + 2] << 8 ) | ( (uint32_t) buffer[n * 4 + 3] ); ism_position->position[n].x = FLOAT_FROM_Q10( (int16_t) ( compactRead >> 21 ) ) * MAX_PI_COMPACT_POSITION_XY_METERS; /* Shift preserves sign bit */ compactRead = compactRead << 11; /* Discard read bits */ ism_position->position[n].y = FLOAT_FROM_Q10( (int16_t) ( compactRead >> 21 ) ) * MAX_PI_COMPACT_POSITION_XY_METERS; /* Shift preserves sign bit */ Loading tests/rtp/ivasrtp.py +0 −10 Original line number Diff line number Diff line Loading @@ -826,16 +826,6 @@ def packPositionsCompact(bitstrm: BitStream, data: any): assert ( type(position) == POSITION ), "Compact position PI Data expects a data of type list[POSITIONS]" #posX = np.uint16(q10(position.x / 10.24)) #posY = np.uint16(q10(position.y / 10.24)) #posZ = np.uint16(q9(position.z / 5.12)) # posX = ctypes.c_int16( q10(position.x / 10.24) ).value # posY = ctypes.c_int16( q10(position.y / 10.24) ).value # posZ = ctypes.c_int16( q9(position.z / 5.12) ).value # bitstrm.append(f"uintbe:8={ctypes.c_uint8(posX >> 3).value}") # bitstrm.append(f"uintbe:8={ctypes.c_uint8(( (posX & MASK_3BIT) << 5 ) | (posY >> 6)).value}") # bitstrm.append(f"uintbe:8={ctypes.c_uint8(( (posY & MASK_6BIT) << 2 ) | (posZ >> 8)).value}") # bitstrm.append(f"uintbe:8={(posZ >> 2)}") bitstrm.append(f"int:11={q10(position.x / 10.24)}") bitstrm.append(f"int:11={q10(position.y / 10.24)}") Loading Loading
lib_util/ivas_rtp_pi_data.c +4 −4 Original line number Diff line number Diff line Loading @@ -767,7 +767,7 @@ static ivas_error packPositionCompact( const IVAS_PIDATA_GENERIC *piData, uint8_ static ivas_error unpackPositionCompact( const uint8_t *buffer, uint32_t numDataBytes, IVAS_PIDATA_GENERIC *piData ) { IVAS_PIDATA_POSITION *position = (IVAS_PIDATA_POSITION *) piData; int32_t compactRead = 0; uint32_t compactRead = 0; /* Compact position data is 4 bytes */ if ( numDataBytes != 4 ) Loading @@ -777,7 +777,7 @@ static ivas_error unpackPositionCompact( const uint8_t *buffer, uint32_t numData position->size = sizeof( IVAS_PIDATA_POSITION ); compactRead = ( (int32_t) buffer[0] << 24 ) | ( (int32_t) buffer[1] << 16 ) | ( (int32_t) buffer[2] << 8 ) | ( (int32_t) buffer[3] ); compactRead = ( (uint32_t) buffer[0] << 24 ) | ( (uint32_t) buffer[1] << 16 ) | ( (uint32_t) buffer[2] << 8 ) | ( (uint32_t) buffer[3] ); position->position.x = FLOAT_FROM_Q10( (int16_t) ( compactRead >> 21 ) ) * MAX_PI_COMPACT_POSITION_XY_METERS; /* Shift preserves sign bit */ compactRead = compactRead << 11; /* Discard read bits */ position->position.y = FLOAT_FROM_Q10( (int16_t) ( compactRead >> 21 ) ) * MAX_PI_COMPACT_POSITION_XY_METERS; /* Shift preserves sign bit */ Loading Loading @@ -893,7 +893,7 @@ static ivas_error packISMPositionCompact( const IVAS_PIDATA_GENERIC *piData, uin static ivas_error unpackISMPositionCompact( const uint8_t *buffer, uint32_t numDataBytes, IVAS_PIDATA_GENERIC *piData ) { uint16_t n; int32_t compactRead = 0; uint32_t compactRead = 0; IVAS_PIDATA_ISM_POSITION *ism_position = (IVAS_PIDATA_ISM_POSITION *) piData; /* Compact position data is 4 bytes */ Loading @@ -908,7 +908,7 @@ static ivas_error unpackISMPositionCompact( const uint8_t *buffer, uint32_t numD for ( n = 0; n < ism_position->numObjects; n++ ) { compactRead = ( (int32_t) buffer[n * 4] << 24 ) | ( (int32_t) buffer[n * 4 + 1] << 16 ) | ( (int32_t) buffer[n * 4 + 2] << 8 ) | ( (int32_t) buffer[n * 4 + 3] ); compactRead = ( (uint32_t) buffer[n * 4] << 24 ) | ( (uint32_t) buffer[n * 4 + 1] << 16 ) | ( (uint32_t) buffer[n * 4 + 2] << 8 ) | ( (uint32_t) buffer[n * 4 + 3] ); ism_position->position[n].x = FLOAT_FROM_Q10( (int16_t) ( compactRead >> 21 ) ) * MAX_PI_COMPACT_POSITION_XY_METERS; /* Shift preserves sign bit */ compactRead = compactRead << 11; /* Discard read bits */ ism_position->position[n].y = FLOAT_FROM_Q10( (int16_t) ( compactRead >> 21 ) ) * MAX_PI_COMPACT_POSITION_XY_METERS; /* Shift preserves sign bit */ Loading
tests/rtp/ivasrtp.py +0 −10 Original line number Diff line number Diff line Loading @@ -826,16 +826,6 @@ def packPositionsCompact(bitstrm: BitStream, data: any): assert ( type(position) == POSITION ), "Compact position PI Data expects a data of type list[POSITIONS]" #posX = np.uint16(q10(position.x / 10.24)) #posY = np.uint16(q10(position.y / 10.24)) #posZ = np.uint16(q9(position.z / 5.12)) # posX = ctypes.c_int16( q10(position.x / 10.24) ).value # posY = ctypes.c_int16( q10(position.y / 10.24) ).value # posZ = ctypes.c_int16( q9(position.z / 5.12) ).value # bitstrm.append(f"uintbe:8={ctypes.c_uint8(posX >> 3).value}") # bitstrm.append(f"uintbe:8={ctypes.c_uint8(( (posX & MASK_3BIT) << 5 ) | (posY >> 6)).value}") # bitstrm.append(f"uintbe:8={ctypes.c_uint8(( (posY & MASK_6BIT) << 2 ) | (posZ >> 8)).value}") # bitstrm.append(f"uintbe:8={(posZ >> 2)}") bitstrm.append(f"int:11={q10(position.x / 10.24)}") bitstrm.append(f"int:11={q10(position.y / 10.24)}") Loading