Commit 87b1a753 authored by Lauros Pajunen's avatar Lauros Pajunen
Browse files

Initial rtpdump port

- Add rtpdump related files to lib_util
- Add flags IVAS_RTPDUMP and RTP_S4_251135_CR26253_0016_REV1
- Port changes to rtpdump.c, g192.c/.h, ivas_error.h
- Add functionality to encoder.c and decoder.c
parent 43b7b28d
Loading
Loading
Loading
Loading
Loading
+75 −0
Original line number Diff line number Diff line
@@ -52,6 +52,9 @@
#include "wmc_auto.h"
#include "options.h"
#include "stl.h"
#ifdef IVAS_RTPDUMP
#include "ivas_rtp_file.h"
#endif


#define WMC_TOOL_SKIP
@@ -129,6 +132,9 @@ typedef struct
    uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS];
    bool objEditEnabled;
    char *objEditFileName;
#ifdef IVAS_RTPDUMP
    char *piOutputFilename;
#endif

} DecArguments;

@@ -840,6 +846,9 @@ static bool parseCmdlIVAS_dec(
    arg->referenceVectorTrajFileName = NULL;
    arg->enableExternalOrientation = false;
    arg->externalOrientationTrajFileName = NULL;
#ifdef IVAS_RTPDUMP
    arg->piOutputFilename = NULL;
#endif

#ifdef SUPPORT_JBM_TRACEFILE
    arg->jbmTraceFilename = NULL;
@@ -918,6 +927,20 @@ static bool parseCmdlIVAS_dec(
            arg->inputFormat = IVAS_DEC_INPUT_FORMAT_RTPDUMP_HF;
            i++;
        }
#ifdef IVAS_RTPDUMP
        else if ( strcmp( argv_to_upper, "-PIDATAFILE" ) == 0 )
        {
            i++;
            if ( argc - i <= 3 || argv[i][0] == '-' )
            {
                fprintf( stderr, "Error: PI Data Output file name not specified!\n\n" );
                usage_dec();
                return false;
            }

            arg->piOutputFilename = argv[i++];
        }
#endif
#ifdef SUPPORT_JBM_TRACEFILE
        else if ( strcmp( argv_to_upper, "-TRACEFILE" ) == 0 )
        {
@@ -1511,10 +1534,19 @@ static void usage_dec( void )
    fprintf( stdout, "--------\n" );
    fprintf( stdout, "-VOIP               : VoIP mode: RTP in G192\n" );
    fprintf( stdout, "-VOIP_hf_only=0     : VoIP mode: EVS RTP Payload Format hf_only=0 in rtpdump\n" );
#ifdef IVAS_RTPDUMP
    fprintf( stdout, "-VOIP_hf_only=1     : VoIP mode: EVS or IVAS RTP Payload Format hf_only=1 in rtpdump\n" );
    fprintf( stdout, "                      The decoder may read rtpdump files containing TS26.445 Annex A.2.2\n" );
    fprintf( stdout, "                      EVS RTP Payload Format or rtpdump files containing TS26.253 Annex A\n" );
    fprintf( stdout, "                      IVAS RTP Payload Format. The SDP parameter hf_only is required.\n" );
    fprintf( stdout, "                      Reading RFC4867 AMR/AMR-WB RTP payload format is not supported.\n" );
    fprintf( stdout, "-PiDataFile PF        Log the timestampped PI data.\n" );
#else
    fprintf( stdout, "-VOIP_hf_only=1     : VoIP mode: EVS RTP Payload Format hf_only=1 in rtpdump\n" );
    fprintf( stdout, "                      The decoder may read rtpdump files containing TS26.445 Annex A.2.2\n" );
    fprintf( stdout, "                      EVS RTP Payload Format. The SDP parameter hf_only is required.\n" );
    fprintf( stdout, "                      Reading RFC4867 AMR/AMR-WB RTP payload format is not supported.\n" );
#endif
#ifdef SUPPORT_JBM_TRACEFILE
    fprintf( stdout, "-Tracefile TF       : VoIP mode: Generate trace file named TF. Requires -no_delay_cmp to\n" );
    fprintf( stdout, "                      be enabled so that trace contents remain in sync with audio output.\n" );
@@ -2654,12 +2686,18 @@ static ivas_error decodeVoIP(
    int16_t delayNumSamples = -1;
    int32_t delayTimeScale = -1;
    int16_t i;
#ifdef IVAS_RTPDUMP
    IVAS_RTP ivasRtp = { 0 };
#else
    FILE *f_rtpstream = NULL;
    EVS_RTPDUMP_DEPACKER rtpdumpDepacker;
    EVS_RTPDUMP_DEPACKER_ERROR rtpdumpDepackerError = EVS_RTPDUMP_DEPACKER_NO_ERROR;
#endif
    uint8_t *auPtr = NULL;
#ifndef IVAS_RTPDUMP
    bool isAMRWB_IOmode;
    uint16_t frameTypeIndex;
#endif
    bool qBit;

    IVAS_DEC_BS_FORMAT bsFormat = IVAS_DEC_BS_UNKOWN;
@@ -2695,11 +2733,20 @@ static ivas_error decodeVoIP(

    delayNumSamples_orig[0] = -1;

#ifndef IVAS_RTPDUMP
    rtpdumpDepacker.rtpdump = NULL;
#endif
    switch ( arg.inputFormat )
    {
        case IVAS_DEC_INPUT_FORMAT_RTPDUMP:
        case IVAS_DEC_INPUT_FORMAT_RTPDUMP_HF:
#ifdef IVAS_RTPDUMP
            if ( ( error = IVAS_RTP_READER_Init( &ivasRtp, arg.inputBitstreamFilename, arg.piOutputFilename ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "error in IVAS_RTP_READER_Init(): %d\n", error );
                goto cleanup;
            }
#else
            f_rtpstream = fopen( arg.inputBitstreamFilename, "r" );

            if ( f_rtpstream == NULL )
@@ -2714,6 +2761,7 @@ static ivas_error decodeVoIP(
                fprintf( stderr, "error in EVS_RTPDUMP_DEPACKER_open(): %d\n", rtpdumpDepackerError );
                goto cleanup;
            }
#endif
            break;
        case IVAS_DEC_INPUT_FORMAT_G192:
            auPtr = au;
@@ -2755,12 +2803,20 @@ static ivas_error decodeVoIP(
    else
    {
        auPtr = au; /* might have been set to RTP packet in prev call */
#ifdef IVAS_RTPDUMP
        error = IVAS_RTP_ReadNextFrame( &ivasRtp, auPtr, &auSize, &rtpTimeStamp, &rtpSequenceNumber, &nextPacketRcvTime_ms, &qBit );
#else
        rtpdumpDepackerError = EVS_RTPDUMP_DEPACKER_readNextFrame( &rtpdumpDepacker, &rtpSequenceNumber, &rtpTimeStamp, &nextPacketRcvTime_ms, &isAMRWB_IOmode, &frameTypeIndex, &qBit, &auPtr, (uint16_t *) &auSize );
#endif

        /* EVS RTP payload format has timescale 16000, JBM uses 1000 internally */
        rtpTimeStamp = rtpTimeStamp / 16;
    }
#ifdef IVAS_RTPDUMP
    if ( error != IVAS_ERR_OK )
#else
    if ( error != IVAS_ERR_OK || rtpdumpDepackerError != EVS_RTPDUMP_DEPACKER_NO_ERROR )
#endif
    {
        fprintf( stderr, "failed to read first RTP packet\n" );
        goto cleanup;
@@ -2931,19 +2987,34 @@ static ivas_error decodeVoIP(
            else
            {
                auPtr = au; /* might have been set to RTP packet in prev call */
#ifdef IVAS_RTPDUMP
                error = IVAS_RTP_ReadNextFrame( &ivasRtp, au, &auSize, &rtpTimeStamp, &rtpSequenceNumber, &nextPacketRcvTime_ms, &qBit );

                /* IVAS RTP payload format has timescale 16000, JBM uses 1000 internally */
                rtpTimeStamp = rtpTimeStamp / 16;
#else
                rtpdumpDepackerError = EVS_RTPDUMP_DEPACKER_readNextFrame( &rtpdumpDepacker, &rtpSequenceNumber, &rtpTimeStamp,
                                                                           &nextPacketRcvTime_ms,
                                                                           &isAMRWB_IOmode, &frameTypeIndex, &qBit,
                                                                           &auPtr, (uint16_t *) &auSize );
                /* EVS RTP payload format has timescale 16000, JBM uses 1000 internally */
                rtpTimeStamp = rtpTimeStamp / 16;
#endif
            }
#ifdef IVAS_RTPDUMP
            if ( error == IVAS_ERR_END_OF_FILE )
#else
            if ( error == IVAS_ERR_END_OF_FILE || rtpdumpDepackerError == EVS_RTPDUMP_DEPACKER_EOF )
#endif
            {
                /* finished reading */
                nextPacketRcvTime_ms = (uint32_t) -1;
            }
#ifdef IVAS_RTPDUMP
            else if ( error != IVAS_ERR_OK )
#else
            else if ( error != IVAS_ERR_OK || rtpdumpDepackerError != EVS_RTPDUMP_DEPACKER_NO_ERROR )
#endif
            {
                fprintf( stderr, "\nError in BS_Reader_ReadVoipFrame_compact, error code: %d\n", error );
                goto cleanup;
@@ -3285,7 +3356,11 @@ static ivas_error decodeVoIP(

cleanup:

#ifdef IVAS_RTPDUMP
    IVAS_RTP_Term( &ivasRtp );
#else
    EVS_RTPDUMP_DEPACKER_close( &rtpdumpDepacker );
#endif
    AudioFileWriter_close( &afWriter );
    JbmOffsetFileWriter_close( &jbmOffsetWriter );
#ifdef SUPPORT_JBM_TRACEFILE
+225 −8
Original line number Diff line number Diff line
@@ -44,6 +44,10 @@
#include "jbm_file_reader.h"
#include "masa_file_reader.h"
#include "wmc_auto.h"
#ifdef IVAS_RTPDUMP
#include "rotation_file_reader.h"
#include "ivas_rtp_file.h"
#endif

#ifdef DEBUG_FORCE_DIR
/* Windows does not define the S_ISREG and S_ISDIR macros in stat.h, so we do.
@@ -155,6 +159,12 @@ typedef struct
#endif
    bool pca;
    bool ism_extended_metadata;
#ifdef IVAS_RTPDUMP
    bool rtpdumpOutput;
    uint32_t numFramesPerPacket;
    char *sceneOrientationTrajFileName;
    char *deviceOrientationTrajFileName;
#endif

} EncArguments;

@@ -198,6 +208,10 @@ int main(
    MasaFileReader *masaReader = NULL;
    IsmFileReader *ismReaders[IVAS_MAX_NUM_OBJECTS] = { NULL, NULL, NULL, NULL };
    int16_t *pcmBuf = NULL;
#ifdef IVAS_RTPDUMP
    RotFileReader *sceneOrientationFileReader = NULL;
    RotFileReader *deviceOrientationFileReader = NULL;
#endif
#ifdef DEBUGGING
    FILE *f_forcedModeProfile = NULL;
#endif
@@ -207,6 +221,11 @@ int main(
    reset_mem( USE_BYTES );
#endif

#ifdef IVAS_RTPDUMP
    uint8_t au[IVAS_MAX_BITS_PER_FRAME / 8];
    IVAS_RTP ivasRtp = { 0 };
#endif

    /*------------------------------------------------------------------------------------------*
     * Parse command-line arguments
     *------------------------------------------------------------------------------------------*/
@@ -233,7 +252,11 @@ int main(

    const BS_WRITER_FORMAT bsWriterFormat = arg.mimeOutput ? BS_WRITER_FORMAT_MIME : BS_WRITER_FORMAT_G192;

#ifdef IVAS_RTPDUMP
    if ( !arg.rtpdumpOutput && BS_Writer_Open_filename( &hBsWriter, arg.outputBitstreamFilename, bsWriterFormat ) != IVAS_ERR_OK )
#else
    if ( BS_Writer_Open_filename( &hBsWriter, arg.outputBitstreamFilename, bsWriterFormat ) != IVAS_ERR_OK )
#endif
    {
        fprintf( stderr, "\nCan't open %s\n\n", arg.outputBitstreamFilename );
        goto cleanup;
@@ -591,6 +614,47 @@ int main(
        }
    }

#ifdef IVAS_RTPDUMP
    /*------------------------------------------------------------------------------------------*
     * RTPDump
     *------------------------------------------------------------------------------------------*/

    if ( arg.rtpdumpOutput )
    {
        if ( ( error = IVAS_RTP_WRITER_Init( &ivasRtp, arg.outputBitstreamFilename, arg.numFramesPerPacket ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError: Can't open output bitstream file for RTP output %s \n\n", arg.outputBitstreamFilename );
            goto cleanup;
        }
    }

    /*------------------------------------------------------------------------------------------*
     * Open scene orientation file
     *------------------------------------------------------------------------------------------*/

    if ( arg.sceneOrientationTrajFileName != NULL )
    {
        if ( ( error = RotationFileReader_open( arg.sceneOrientationTrajFileName, &sceneOrientationFileReader ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError: Can't open scene orientation file %s \n\n", arg.sceneOrientationTrajFileName );
            goto cleanup;
        }
    }

    /*------------------------------------------------------------------------------------------*
     * Open device orientation file
     *------------------------------------------------------------------------------------------*/

    if ( arg.deviceOrientationTrajFileName != NULL )
    {
        if ( ( error = RotationFileReader_open( arg.deviceOrientationTrajFileName, &deviceOrientationFileReader ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError: Can't open device orientation file %s \n\n", arg.deviceOrientationTrajFileName );
            goto cleanup;
        }
    }
#endif

    int16_t numSamplesRead = 0;
    uint16_t bitStream[IVAS_MAX_BITS_PER_FRAME];
    uint16_t numBits = 0;
@@ -755,6 +819,63 @@ int main(
        }

        /* *** Encode one frame *** */
#ifdef IVAS_RTPDUMP
        if ( ivasRtp.hPack )
        {
            bool isMono = ( arg.inputFormat == IVAS_ENC_INPUT_MONO );
            bool forcePacket = ( numSamplesRead < pcmBufSize ); /* If EoF force Packet generation */

            ivasRtp.nWrittenPiData = 0;

            /* scene orientation */
            if ( sceneOrientationFileReader )
            {
                PIDATA_TS *piDataTs = &ivasRtp.piData[ivasRtp.nWrittenPiData++];
                IVAS_PIDATA_ORIENTATION *scene = &piDataTs->data.scene;

                memset( piDataTs, 0, sizeof( PIDATA_TS ) );
                scene->size = sizeof( IVAS_PIDATA_ORIENTATION );
                scene->piDataType = IVAS_PI_SCENE_ORIENTATION;

                if ( ( error = HeadRotationFileReading( sceneOrientationFileReader, &scene->orientation, NULL ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError %s while reading scene orientation from %s\n", IVAS_ENC_GetErrorMessage( error ), RotationFileReader_getFilePath( sceneOrientationFileReader ) );
                    goto cleanup;
                }
            }

            /* device orientation */
            if ( deviceOrientationFileReader )
            {
                PIDATA_TS *piDataTs = &ivasRtp.piData[ivasRtp.nWrittenPiData++];
                IVAS_PIDATA_ORIENTATION *device = &piDataTs->data.deviceUnCompensated;

                memset( piDataTs, 0, sizeof( PIDATA_TS ) );
                device->size = sizeof( IVAS_PIDATA_ORIENTATION );
                device->piDataType = IVAS_PI_DEVICE_ORIENTATION_COMPENSATED;

                if ( ( error = HeadRotationFileReading( deviceOrientationFileReader, &device->orientation, NULL ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError %s while reading device orientation from %s\n", IVAS_ENC_GetErrorMessage( error ), RotationFileReader_getFilePath( deviceOrientationFileReader ) );
                    goto cleanup;
                }
            }

            if ( ( error = IVAS_ENC_EncodeFrameToCompact( hIvasEnc, pcmBuf, pcmBufSize, au, &numBits ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nencodeFrame failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) );
                goto cleanup;
            }

            if ( ( error = IVAS_RTP_WriteNextFrame( &ivasRtp, au, numBits, isMono, forcePacket ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nError %s while pushing audio frame to RTP pack\n", IVAS_ENC_GetErrorMessage( error ) );
                goto cleanup;
            }
        }
        else
        {
#endif
            if ( ( error = IVAS_ENC_EncodeFrameToSerial( hIvasEnc, pcmBuf, pcmBufSize, bitStream, &numBits ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nencodeFrame failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) );
@@ -767,6 +888,9 @@ int main(
                fprintf( stderr, "\nBS_Writer_WriteFrame_short failed, error code %d\n\n", error );
                goto cleanup;
            }
#ifdef IVAS_RTPDUMP
        }
#endif

        frame++;
        if ( !arg.quietModeEnabled )
@@ -835,6 +959,20 @@ cleanup:
        fclose( f_bitrateProfile );
    }

#ifdef IVAS_RTPDUMP
    if ( sceneOrientationFileReader )
    {
        RotationFileReader_close( &sceneOrientationFileReader );
    }

    if ( deviceOrientationFileReader )
    {
        RotationFileReader_close( &deviceOrientationFileReader );
    }

    IVAS_RTP_Term( &ivasRtp );
#endif

    IVAS_ENC_Close( &hIvasEnc );

#ifdef WMOPS
@@ -890,6 +1028,11 @@ static bool parseCmdlIVAS_enc(
    arg->mimeOutput = false;
    arg->ism_extended_metadata = false;
    arg->complexityLevel = IVAS_ENC_COMPLEXITY_LEVEL_THREE;
#ifdef IVAS_RTPDUMP
    arg->rtpdumpOutput = false;
    arg->sceneOrientationTrajFileName = NULL;
    arg->deviceOrientationTrajFileName = NULL;
#endif
#ifdef DEBUGGING
    arg->forcedMode = IVAS_ENC_FORCE_UNFORCED;
    arg->forcedModeFile = NULL;
@@ -1668,6 +1811,72 @@ static bool parseCmdlIVAS_enc(
            i++;
        }

#ifdef IVAS_RTPDUMP
        /*-----------------------------------------------------------------*
         * RTPDump output
         *-----------------------------------------------------------------*/

        else if ( strcmp( argv_to_upper, "-RTPDUMP" ) == 0 )
        {
            i++;
            arg->rtpdumpOutput = true;
            if ( i < argc - 4 )
            {
                if ( !is_digits_only( argv[i] ) )
                {
                    arg->numFramesPerPacket = 1; /* Default to 1 frame per packet */
                }
                else
                {
                    arg->numFramesPerPacket = atoi( argv[i++] );
                    if ( arg->numFramesPerPacket > IVAS_MAX_FRAMES_PER_RTP_PACKET )
                    {
                        fprintf( stderr, "numFramesPerPacket(%d) exceeds max frames per packet (%d) \n", arg->numFramesPerPacket, IVAS_MAX_FRAMES_PER_RTP_PACKET );
                        arg->numFramesPerPacket = 1;
                    }
                }
            }
            fprintf( stdout, "Output format: RTPDump using %d frames/packet \n", arg->numFramesPerPacket );
        }

        /*-----------------------------------------------------------------*
         * Scene orientation
         *-----------------------------------------------------------------*/

        else if ( strcmp( argv_to_upper, "-SCENE_ORIENTATION" ) == 0 )
        {
            i++;
            if ( argc - i <= 4 || argv[i][0] == '-' )
            {
                fprintf( stderr, "Error: Scene orientation file name not specified!\n\n" );
                usage_enc();
                return false;
            }

            arg->sceneOrientationTrajFileName = argv[i];
            i++;
        }

        /*-----------------------------------------------------------------*
         * Device orientation
         *-----------------------------------------------------------------*/

        else if ( strcmp( argv_to_upper, "-DEVICE_ORIENTATION" ) == 0 )
        {
            i++;
            if ( argc - i <= 4 || argv[i][0] == '-' )
            {
                fprintf( stderr, "Error: Device orientation file name not specified!\n\n" );
                usage_enc();
                return false;
            }

            arg->deviceOrientationTrajFileName = argv[i];
            i++;
        }

#endif

        /*-----------------------------------------------------------------*
         * Option not recognized
         *-----------------------------------------------------------------*/
@@ -1880,6 +2089,14 @@ static void usage_enc( void )
#endif
    fprintf( stdout, "-q                  : Quiet mode, no frame counters\n" );
    fprintf( stdout, "                      default is deactivated\n" );
#ifdef IVAS_RTPDUMP
    fprintf( stdout, "-rtpdump <N>        : RTPDump output, hf_only=1 by default. The encoder will packetize the \n" );
    fprintf( stdout, "                      bitstream frames into TS26.253 Annex A IVAS RTP Payload Format packets and \n" );
    fprintf( stdout, "                      writes those to the output file. In EVS mono operating mode, TS26.445 Annex A.2.2 \n" );
    fprintf( stdout, "                      EVS RTP Payload Format is used. Optional N represents number of frames per RTP packet\n" );
    fprintf( stdout, "-scene_orientation  : Scene orientation trajectory file. Only used with rtpdump output.\n" );
    fprintf( stdout, "-device_orientation : Device orientation trajectory file. Only used with rtpdump output.\n" );
#endif
    fprintf( stdout, "\n" );

    return;
+24 −0
Original line number Diff line number Diff line
@@ -147,6 +147,14 @@ typedef enum
    IVAS_ERR_LC3PLUS_INVALID_BITRATE,
    IVAS_ERR_INVALID_SPLIT_REND_CONFIG,

    /*----------------------------------------*
     *               rtp errors               *
     *----------------------------------------*/
    IVAS_ERR_RTP_UNDERFLOW = 0x7000,
    IVAS_ERR_RTP_INSUFFICIENT_OUTPUT_SIZE,
    IVAS_ERR_RTP_UNPACK_PI_DATA,
    IVAS_ERR_RTP_UNSUPPORTED_FRAME,

    /*----------------------------------------*
     *              unknown error             *
     *----------------------------------------*/
@@ -286,6 +294,22 @@ static inline const char *ivas_error_to_string( ivas_error error_code )
    {
        return "data error";
    }
    if ( ( error_code & 0x7000 ) == 0x7000 )
    {
        switch ( error_code )
        {
            case IVAS_ERR_RTP_UNDERFLOW:
                return "RTP Undeflow in reading frame/packet";
            case IVAS_ERR_RTP_INSUFFICIENT_OUTPUT_SIZE:
                return "Output buffer size is insufficient";
            case IVAS_ERR_RTP_UNPACK_PI_DATA:
                return "Unpacking PI data failure";
            case IVAS_ERR_RTP_UNSUPPORTED_FRAME:
                return "Unsupported RTP frame";
            default:
                return "rtp error";
        }
    }

    return "Unknown error";
}
+4 −0
Original line number Diff line number Diff line
@@ -135,6 +135,10 @@
#define FIX_2140_OBJECT_EDITING_SANITIZER_ISSUES        /* Nokia: Issue 2140, fixes three different sanitizer issues persisting in object editing code. */
#define NONBE_FIX_1172_OBJ_EDIT_JBM                     /* VA: issue 1172: fix OMASA object editing in JBM */

// RTPDUMP porting
#define RTP_S4_251135_CR26253_0016_REV1                /* RTP Pack/Unpack API corresponding to CR 26253 */
#define IVAS_RTPDUMP                                   /* RTPDUMP writing and reading for IVAS payloads */

/* #################### End BASOP porting switches ############################ */

#endif
+4 −0
Original line number Diff line number Diff line
@@ -482,7 +482,11 @@ G192_ERROR G192_WriteVoipFrame_short(
    const uint16_t *serial,
    const int16_t numBits,
    uint16_t const rtpSequenceNumber,
#ifdef IVAS_RTPDUMP
    uint32_t const rtpTimeStamp,
#else
    uint16_t const rtpTimeStamp,
#endif
    uint32_t const rcvTime_ms )
{
    int16_t G192_HEADER[2], G192_DATA[IVAS_MAX_BITS_PER_FRAME];
Loading