Unified · Split
| @@ -106,6 +106,14 @@ class ISVCDecoder { · 105 unmodified lines | ||
| 106 | 106 | unsigned char** ppDst, |
| 107 | 107 | SBufferInfo* pDstInfo) = 0; |
| 108 | 108 | |
| 109 | + /* | |
| 110 | + * This function parse input bitstream only, and rewrite possible SVC syntax to AVC syntax | |
| 111 | + * return: 0 - success; otherwise -failed; | |
| 112 | + */ | |
| 113 | + virtual DECODING_STATE EXTAPI DecodeParser (const unsigned char* pSrc, | |
| 114 | + const int iSrcLen, | |
| 115 | + SParserBsInfo* pDstInfo) = 0; | |
| 116 | + | |
| 109 | 117 | /* |
| 110 | 118 | * this API does not work for now!! This is for future use to support non-I420 color format output. |
| 111 | 119 | */ |
| @@ -169,6 +177,10 @@ DECODING_STATE (*DecodeFrame2) (ISVCDecoder*, const unsigned char* pSrc, · 57 unmodified lines | ||
| 169 | 177 | unsigned char** ppDst, |
| 170 | 178 | SBufferInfo* pDstInfo); |
| 171 | 179 | |
| 180 | +DECODING_STATE (*DecodeParser) (ISVCDecoder*, const unsigned char* pSrc, | |
| 181 | + const int iSrcLen, | |
| 182 | + SParserBsInfo* pDstInfo); | |
| 183 | + | |
| 172 | 184 | DECODING_STATE (*DecodeFrameEx) (ISVCDecoder*, const unsigned char* pSrc, |
| 173 | 185 | const int iSrcLen, |
| 174 | 186 | unsigned char* pDst, |
| @@ -447,4 +447,12 @@ typedef struct TagDecoderCapability { · 446 unmodified lines | ||
| 447 | 447 | bool bRedPicCap; |
| 448 | 448 | } SDecoderCapability; |
| 449 | 449 | |
| 450 | +typedef struct TagParserBsInfo { | |
| 451 | + int iNalNum; //total NAL number in current AU | |
| 452 | + int iNalLenInByte [MAX_NAL_UNITS_IN_LAYER]; //each nal length | |
| 453 | + unsigned char* pDstBuff; //outputted dst buffer for parsed bitstream | |
| 454 | + int iSpsWidthInPixel; //required SPS width info | |
| 455 | + int iSpsHeightInPixel; //required SPS height info | |
| 456 | +} SParserBsInfo, PParserBsInfo; | |
| 457 | + | |
| 450 | 458 | #endif//WELS_VIDEO_CODEC_APPLICATION_DEFINITION_H__ |
| @@ -85,6 +85,9 @@ virtual DECODING_STATE EXTAPI DecodeFrame2 (const unsigned char* kpSrc, · 84 unmodified lines | ||
| 85 | 85 | const int kiSrcLen, |
| 86 | 86 | unsigned char** ppDst, |
| 87 | 87 | SBufferInfo* pDstInfo); |
| 88 | +virtual DECODING_STATE EXTAPI DecodeParser (const unsigned char* kpSrc, | |
| 89 | + const int kiSrcLen, | |
| 90 | + SParserBsInfo* pDstInfo); | |
| 88 | 91 | virtual DECODING_STATE EXTAPI DecodeFrameEx (const unsigned char* kpSrc, |
| 89 | 92 | const int kiSrcLen, |
| 90 | 93 | unsigned char* pDst, |
| @@ -453,6 +453,13 @@ DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc, · 452 unmodified lines | ||
| 453 | 453 | return dsErrorFree; |
| 454 | 454 | } |
| 455 | 455 | |
| 456 | +DECODING_STATE CWelsDecoder::DecodeParser (const unsigned char* kpSrc, | |
| 457 | + const int kiSrcLen, | |
| 458 | + SParserBsInfo* pDstInfo) { | |
| 459 | +//TODO, add function here | |
| 460 | + return (DECODING_STATE) m_pDecContext->iErrorCode; | |
| 461 | +} | |
| 462 | + | |
| 456 | 463 | DECODING_STATE CWelsDecoder::DecodeFrame (const unsigned char* kpSrc, |
| 457 | 464 | const int kiSrcLen, |
| 458 | 465 | unsigned char** ppDst, |
| @@ -27,8 +27,9 @@ void CheckDecoderInterface(ISVCDecoder* p, CheckFunc check) { · 26 unmodified lines | ||
| 27 | 27 | CHECK(3, p, DecodeFrame); |
| 28 | 28 | CHECK(4, p, DecodeFrame2); |
| 29 | 29 | CHECK(5, p, DecodeFrameEx); |
| 30 | − CHECK(6, p, SetOption); | |
| 31 | − CHECK(7, p, GetOption); | |
| 30 | + CHECK(6, p, DecodeParser); | |
| 31 | + CHECK(7, p, SetOption); | |
| 32 | + CHECK(8, p, GetOption); | |
| 32 | 33 | } |
| 33 | 34 | |
| 34 | 35 | struct bool_test_struct { |
| @@ -88,13 +88,18 @@ struct SVCDecoderImpl : public ISVCDecoder { · 87 unmodified lines | ||
| 88 | 88 | EXPECT_TRUE (gThis == this); |
| 89 | 89 | return static_cast<DECODING_STATE> (5); |
| 90 | 90 | } |
| 91 | + virtual DECODING_STATE EXTAPI DecodeParser (const unsigned char* pSrc, | |
| 92 | + const int iSrcLen, SParserBsInfo* pDstInfo) { | |
| 93 | + EXPECT_TRUE (gThis == this); | |
| 94 | + return static_cast<DECODING_STATE> (6); | |
| 95 | + } | |
| 91 | 96 | virtual long EXTAPI SetOption (DECODER_OPTION eOptionId, void* pOption) { |
| 92 | 97 | EXPECT_TRUE (gThis == this); |
| 93 | − return 6; | |
| 98 | + return 7; | |
| 94 | 99 | } |
| 95 | 100 | virtual long EXTAPI GetOption (DECODER_OPTION eOptionId, void* pOption) { |
| 96 | 101 | EXPECT_TRUE (gThis == this); |
| 97 | − return 7; | |
| 102 | + return 8; | |
| 98 | 103 | } |
| 99 | 104 | }; |
| 100 | 105 | |