⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mpeg2_vld_intra_n.sa

📁 h263,jpeg,mpeg2编解码核心程序(TI DSP C64xx)
💻 SA
📖 第 1 页 / 共 3 页
字号:
[dc_size]   CMPLT   dc_diff,    half_range, test0[test0]     ADD     dc_diff,    1,          t4[test0]     SHL     half_range, 1,          t5[test0]     SUB     t4,         t5,         dc_diff            LDW     *dc_pred[cc], pred            ADD     pred,         dc_diff,  val            STW     val,          *dc_pred[cc]* ------------------------------------------------------------------------- **  Intra DC: de-quantization and store result                               ** ------------------------------------------------------------------------- *           SUB     3,          intra_dc_precision,     t1           SHL     val,        t1,     val           STH     val,        *outi* ------------------------------------------------------------------------- **  Intra DC: mismatch control                                               ** ------------------------------------------------------------------------- *            ADD     sum,    val,    sum* ------------------------------------------------------------------------- **  Intra DC: advance bitstream                                              ** ------------------------------------------------------------------------- *            ADD     len,        dc_size,    len            SUB     const32,    len,        len_c            SHL     top0h:top0l,  len,      at6h:at6l            SHRU    top1,         len_c,    at7            MV      at6h,         top0h            ADD     at6l,         at7,      top0l                    ADD     bptr,       len,        bptr            CMPGT   bptr,       const31,    test2            [test2]     MV      word1,      word1_rw[test2]     MV      word2,      word1[test2]     LDW     *A5++,      word2            AND     bptr,       const31,    bptr            SUB     const32,    bptr,       bptr_cmpl            SHL     word1,      bptr,       at8            SHRU    word2,      bptr_cmpl,  at9            ADD     at8,        at9,        top1* ------------------------------------------------------------------------- **  Intra DC: update pointers  (can be done before)                          ** ------------------------------------------------------------------------- *            ADD     Wptr,   2,  Wptr            ADD     Zptr,   1,  Zptr            * ========================================================================= **  Decode AC coefficients                                                   ** ========================================================================= *             MV      top0h:top0l,   at6h:at6l             ac_loop:    .trip 1 * ------------------------------------------------------------------------- **  Length computation                                                       ** ------------------------------------------------------------------------- *            NORM    at6h:at6l,    nrm            SHL     at6h:at6l,    nrm,     at1h:at1l  ; leading 0s/1s             MPY     nrm,          -16,     at2        ; sub-table index            SUB     len_tbl_adr,  at2,     at3            SHRU    at1h:at1l,    const36, at4h:at4l  ; 4 extra bits             LDBU    *at3[at4l],   len                 ; get length            SUB     const32,      len,     len_c* ------------------------------------------------------------------------- **  advance bitstream                                                        ** ------------------------------------------------------------------------- *            SHL     top0h:top0l,  len,        at6h:at6l            SHRU    top1,         len_c,      at7            SHRU    top0h:top0l,  8,          empty:top0_bk            MV      at6h,         top0h            ADD     at6l,         at7,        top0l                        ADD     bptr,         len,        bptr1            CMPGT   bptr1,        const31,    test2            [test2]     MV      word1,        word1_rw[test2]     MV      word2,        word1[test2]     LDW     *A5++,        word2            AND     bptr1,        const31,    bptr            SUB     const32,      bptr,       bptr_cmpl            SHL     word1,        bptr,       at8            SHRU    word2,        bptr_cmpl,  at9            ADD     at8,          at9,        top1       * ------------------------------------------------------------------------- **  Run-Level escape code decode                                             ** ------------------------------------------------------------------------- *            SUB     len,        const24,        no_esc                       EXTU    top0_bk,    6,      26,     run            EXT     top0_bk,    12,     20,     level* ------------------------------------------------------------------------- **  Run-Level "normal" code decode                                           ** ------------------------------------------------------------------------- *            SUB     len,        5,          rld_left            CMPLT   len,        5,          test3[test3]     ZERO    rld_left            SHL     len,        5,          t2                      SHL     top0_bk,    rld_left,   t3    ; align last 5 bits to MSB            SHRU    t3,         27,         t3    ; keep last 5 bits inc sign            ADD     t2,         t3,         t4    ; add to sub-table index            ADD     t4,         t4,         t4b   ; entries are half-words[no_esc]    LDB     *rld_table_adr[t4b],    level ; access[no_esc]    LDB     *rld_table_adr_1[t4b],  run   ; A_rld_table_adr+1            * ------------------------------------------------------------------------- *            CMPGT   run,    const63,     eob_err* ------------------------------------------------------------------------- **  De-quantization                                                          ** ------------------------------------------------------------------------- *                        CMPLT   level,    0,        sign            MPY     level,    2,        level2[!eob_err]  LDH     *++Wptr[run],       W [!eob_err]  ADD     Wptr,     2,        Wptr          [!eob_err]  CMPGT   Wptr,     Wptr_end, eob_err            MPY     qscl,     W,        qW                     MPY     qW,       level2,   level4[sign]      ADD     level4,   const31,  level4    ; add rounding constant            SSHL    level4,   15,       level5    ; saturate            SHR     level5,   shift_12Q4, level6                AND     level6,   mask_12Q4,  level_f   [!eob_err]  ADD     sum,      level_f,  sum       ; mismatch contol[!eob_err]  LDB     *++Zptr[run],       Z             ADD     Zptr,     1,        Zptr          [!eob_err]  STH     level_f,  *+outi[Z][!eob_err]  B       ac_loop* ========================================================================= **  Block loop:                                                              ** ========================================================================= *mismatch:            ADD     outi,  const128,     outi      ; set to next 8x8 block* ------------------------------------------------------------------------- **  Mismatch control: if sum is even, toggle last bit of last coefficient* ------------------------------------------------------------------------- *            AND     mism_bit,   sum,    odd                     [!odd]      LDH     *-outi[1],          last_coeff[!odd]      XOR     mism_bit,           last_coeff, last_coeff  [!odd]      STH     last_coeff,         *-outi[1]  ; of last coefficient        CMPGT      run,      const65, fault[!fault]CMPGT      Wptr,     Wptr_end,fault[fault] B          exitcont:[cnt]       BDEC    block_loop,     cnt* ========================================================================= **  Exit: update bistream pointer                                            ** ========================================================================= *exit        SUB        A5,          bsbuf, byte_diff        SHR        byte_diff,   2,     next_wptr        SHRU       top0h:top0l, 8,    empty1:top0        SHL        top0l,       24,   e0        SHRU       top1,        8,    e1        ADD        e0,          e1,   top1            SUB        bptr,        8,    bptr        CMPLT      bptr,        0,    lz[lz]    MV         word1,             word2[lz]    MV         word1_rw,          word1[lz]    ADD        bptr,     const32, bptr[lz]    SUBAW      A5,          1,     A5[lz]    SUB        A5,          bsbuf, byte_diff[lz]    SHR        byte_diff,   2,     next_wptr        STW        next_wptr,   *+Mpeg2v[1]        STW        bptr,        *+Mpeg2v[2]        STW        word1,       *+Mpeg2v[3]        STW        word2,       *+Mpeg2v[4]        STW        top0,        *+Mpeg2v[5]        STW        top1,        *+Mpeg2v[6]        STW        fault,       *+Mpeg2v[12]        ZERO    amr_config        MVC     amr_config, AMR        MVC     csr_bk,     CSR     ; restore interrupts    .endproc* ========================================================================= **   End of file:  mpeg2_vld_intra                                           ** ------------------------------------------------------------------------- **             Copyright (c) 2001 Texas Instruments, Incorporated.           **                            All Rights Reserved.                           ** ========================================================================= *

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -