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

📄 h263gob.c

📁 Linux下的基于intel的ipp库的h.263解码源代码
💻 C
字号:
/******************************************************************************
//               INTEL CORPORATION PROPRIETARY INFORMATION
//  This software is supplied under the terms of a license agreement or
//  nondisclosure agreement with Intel Corporation and may not be copied
//  or disclosed except in accordance with the terms of that agreement.
//        Copyright (c) 2003 Intel Corporation. All Rights Reserved.
//
//  Description:
//    Intel(R) Integrated Performance Primitives Sample Code H263 Decoder
//
//  Function List:
//    decode_gob_ipic_h263()
//    decode_gob_ppic_h263()
//
******************************************************************************/
#include "samph263.h"


/******************************************************************************
// Function Name:   decode_gob_ipic_h263
//
// Description:     Decode one GOB in I Picture
//
// Parameter:
// Input:
//        stream:   Pointer to sample_bitstream structure holding input stream
//         state:   Pointer to h263_dec_state structure holding decode status
// Output:
//        stream:   Pointer to sample_bitstream structure holding input stream
//                  Stream position pointer is updated to next available byte
//         state:   Pointer to h263_dec_state structure holding decode status
//
// Return:
// sample_status:   
//  [SAMPLE_STATUS_NOERR]:            Succeeds
//  [SAMPLE_STATUS_BITSTREAM_ERR]:    Stream parsing error occurs
//  [SAMPLE_STATUS_NOTSUPPORTED_ERR]: Stream syntax is not supported by 
//                                    current sample decoder
//  [SAMPLE_STATUS_ERR]:              Other error occurs during decoding
//
// Notes:   None
******************************************************************************/
sample_status decode_gob_ipic_h263(sample_bitstream    *stream, 
                                   h263_dec_state      *state)
{
    sample_status  ret;
    int         i;

    /* Get MB Start Pointer */
    state->cur_mb.y_ptr  = state->cur_gob.y_ptr;
    state->cur_mb.cb_ptr = state->cur_gob.cb_ptr;
    state->cur_mb.cr_ptr = state->cur_gob.cr_ptr;

    for(i=0; i < state->mb_per_row; i++) {
        /* Decode one MB of GOB in I Picture */
        ret = decode_mb_ipic_h263(stream, state);
        if(SAMPLE_STATUS_NOERR != ret) {
            return ret;
        }

        /* Update pointers */
        state->mb_index ++;
        state->cur_mb.y_ptr  += SAMPLE_VIDEO_MB_SIZE;
        state->cur_mb.cb_ptr += SAMPLE_VIDEO_BLOCK_SIZE;
        state->cur_mb.cr_ptr += SAMPLE_VIDEO_BLOCK_SIZE;
    }

    return SAMPLE_STATUS_NOERR;
}

/******************************************************************************
// Function Name:   decode_gob_ppic_h263
//
// Description:     Decode one GOB in P Picture
//
// Parameter:
// Input:
//        stream:   Pointer to sample_bitstream structure holding input stream
//         state:   Pointer to h263_dec_state structure holding decode status
// Output:
//        stream:   Pointer to sample_bitstream structure holding input stream
//                  Stream position pointer is updated to next available byte
//         state:   Pointer to h263_dec_state structure holding decode status
//
// Return:
// sample_status:   
//  [SAMPLE_STATUS_NOERR]:            Succeed
//  [SAMPLE_STATUS_BITSTREAM_ERR]:    Stream parse error
//  [SAMPLE_STATUS_NOTSUPPORTED_ERR]: Stream syntax is not supported by 
//                                    current sample decoder
//  [SAMPLE_STATUS_ERR]:              Other error occurs during decoding
//
// Notes:   None
******************************************************************************/
sample_status decode_gob_ppic_h263(sample_bitstream    *stream, 
                                   h263_dec_state      *state)
{
    sample_status  ret;
    int         i;

    /* Get MV Buffer Start Pointer */
    state->cur_mv        = state->mv_buffer;

    /* Get MB Start Pointer */
    state->cur_mb.y_ptr  = state->cur_gob.y_ptr;
    state->cur_mb.cb_ptr = state->cur_gob.cb_ptr;
    state->cur_mb.cr_ptr = state->cur_gob.cr_ptr;

    state->ref_mb.y_ptr  = state->ref_gob.y_ptr;
    state->ref_mb.cb_ptr = state->ref_gob.cb_ptr;
    state->ref_mb.cr_ptr = state->ref_gob.cr_ptr;

    for(i=0; i < state->mb_per_row; i++) {
        /* Decode one MB of GOB in P Picture */
        if((ret = decode_mb_ppic_h263(stream, state)) != SAMPLE_STATUS_NOERR) {
            return ret;
        }
        state->mb_index ++;

        /* Update pointers */
        state->cur_mv++;        
        state->cur_mb.y_ptr  += SAMPLE_VIDEO_MB_SIZE;
        state->cur_mb.cb_ptr += SAMPLE_VIDEO_BLOCK_SIZE;
        state->cur_mb.cr_ptr += SAMPLE_VIDEO_BLOCK_SIZE;

        state->ref_mb.y_ptr  += SAMPLE_VIDEO_MB_SIZE;
        state->ref_mb.cb_ptr += SAMPLE_VIDEO_BLOCK_SIZE;
        state->ref_mb.cr_ptr += SAMPLE_VIDEO_BLOCK_SIZE;
    }

    return SAMPLE_STATUS_NOERR;
}

/* EOF */

⌨️ 快捷键说明

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