cisco / openh264

Open Source H.264 Codec
BSD 2-Clause "Simplified" License
5.51k stars 1.78k forks source link

cavlc+bframe decode error #3013

Open chezhan3 opened 6 years ago

chezhan3 commented 6 years ago

@xiaotiansf Hi, I used JM to encode B frame bitstream with the Entropy coding = cavlc,and used openh264 to decode, it can only decoded 2 frames(set to 9); But JM could decode correctly. Attach the bitstream file for you.

================================================================ ./h264dec /home/jenkins/openh264/res/Cisco_Adobe_PDF_sample_a_1024x768_CAVLC_Bframe_9.26 4 Adobe.yuv H264 source file name: /home/jenkins/openh264/res/Cisco_Adobe_PDF_sample_a_1024x768_CAVLC_Bframe_9.264.. Sequence output file name: Adobe.yuv.. [OpenH264] this = 0x0x10ebc80, Warning:DecodeCurrentAccessUnit() failed (459806) in frame: 1 uiDId: 0 uiQId: 0 [OpenH264] this = 0x0x10ebc80, Warning:DecodeCurrentAccessUnit() failed (459806) in frame: 1 uiDId: 0 uiQId: 0 [OpenH264] this = 0x0x10ebc80, Warning:DecodeCurrentAccessUnit() failed (459806) in frame: 1 uiDId: 0 uiQId: 0 [OpenH264] this = 0x0x10ebc80, Warning:DecodeCurrentAccessUnit() failed (459806) in frame: 1 uiDId: 0 uiQId: 0 [OpenH264] this = 0x0x10ebc80, Warning:DecodeCurrentAccessUnit() failed (459806) in frame: 1 uiDId: 0 uiQId: 0 [OpenH264] this = 0x0x10ebc80, Warning:DecodeCurrentAccessUnit() failed (459806) in frame: 1 uiDId: 0 uiQId: 0 [OpenH264] this = 0x0x10ebc80, Warning:DecodeCurrentAccessUnit() failed (459806) in frame: 1 uiDId: 0 uiQId: 0

iWidth: 1024 height: 768 Frames: 2 decode time: 0.026108 sec FPS: 76.604872 fps

JM decoded it successfully.

./lencod.exe -d encoder_main.cfg Setting Default Parameters... Parsing Configfile encoder_main.cfg...............................................................................................................................................................................................................................................................................................

------------------------------- JM 19.0 (FRExt) ------------------------------- Input YUV file : /home/jenkins/JM/bin/Cisco_Adobe_PDF_sample_a_1024x768_CAVLC_Bframe_9.yuv Output H.264 bitstream : Cisco_Adobe_PDF_sample_a_1024x768_CAVLC_Bframe_9.264 Output YUV file : Cisco_Adobe_PDF_sample_a_1024x768_CAVLC_Bframe_9_rec.yuv YUV Format : YUV 4:2:0 Frames to be encoded : 9 Freq. for encoded bitstream : 30.00 PicInterlace / MbInterlace : 0/0 Transform8x8Mode : 0 ME Metric for Refinement Level 0 : SAD ME Metric for Refinement Level 1 : Hadamard SAD ME Metric for Refinement Level 2 : Hadamard SAD Mode Decision Metric : Hadamard SAD Motion Estimation for components : Y Image format : 1024x768 (1024x768) Error robustness : Off Search range : 32 Total number of references : 5 References for P slices : 5 References for B slices (L0, L1) : 5, 1 Sequence type : I-B-B-B-B-B-B-B-P-B-B-B-B-B-B-B-P (QP: I 28, P 28, B 30) Entropy coding method : CAVLC Profile/Level IDC : (77,52) Motion Estimation Scheme : Fast Full Search Search range restrictions : none RD-optimized mode decision : used Data Partitioning Mode : 1 partition Output File Format : H.264/AVC Annex B Byte Stream Format

Frame Bit/pic QP SnrY SnrU SnrV Time(ms) MET(ms) Frm/Fld Ref

00000(NVB) 184 00000(IDR) 1084808 28 48.852 51.475 51.149 525 0 FRM 3 00008(IDR) 1086088 28 49.113 50.694 49.949 484 0 FRM 3 00001( B ) 504 30 48.944 50.694 49.949 15066 14385 FRM 0 00002( B ) 448 30 48.943 50.694 49.949 15425 14734 FRM 0 00003( B ) 624 30 49.059 50.694 49.949 15399 14697 FRM 0 00004( B ) 624 30 49.057 50.694 49.949 15299 14608 FRM 0 00005( B ) 904 30 49.051 50.694 49.949 15367 14663 FRM 0 00006( B ) 568 30 49.059 50.694 49.949 14991 14317 FRM 0 00007( B ) 904 30 49.053 50.694 49.949 15154 14469 FRM 0

Total Frames: 9 Leaky BucketRateFile does not have valid entries. Using rate calculated from avg. rate Number Leaky Buckets: 8 Rmin Bmin Fmin 7251570 1929177 1929177 9064440 1868748 1868748 10877310 1808319 1808319 12690180 1747890 1747890 14503050 1687461 1687461 16315920 1627032 1627032 18128790 1566603 1566603 19941660 1506174 1506174

================================================================== Cisco_Adobe_PDF_sample_a_1024x768_CAVLC_Bframe_9.zip

chezhan3 commented 6 years ago

Cisco_Adobe_PDF_sample_a_1024x768_5_CABAC_Bframes_9.zip

xiaotiansf commented 6 years ago

@chezhan3 Right, I did not implement cavlc b-frame and thought it is not being used so often. Fortunately most implementations of cabac b-frame decoding are the same as those of cavlc b-frame decoding. It is much simpler than cabac b-frame. one developer @centricular.com had interest in continuing the effort and I told him that the cavlc-frame decoding is currently missing.

chezhan3 commented 6 years ago

Hi, I got it, thank you☺ Regards, Chen Zhang -X (chezhan3 - CIIC at Cisco)

[https://www.cisco.com/c/dam/m/en_us/signaturetool/images/logo/Cisco_Logo_no_TM_Medium_Gray-RGB_43px.png]

Chen Zhang Intern chezhan3@cisco.commailto:chezhan3@cisco.com Tel:

Cisco Systems, Inc.

China cisco.com

[http://www.cisco.com/assets/swa/img/thinkbeforeyouprint.gif]

Think before you print.

This email may contain confidential and privileged material for the sole use of the intended recipient. Any review, use, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message. Please click herehttp://www.cisco.com/c/en/us/about/legal/terms-sale-software-license-agreement/company-registration-information.html for Company Registration Information.

From: Xiaotian Shi notifications@github.com Sent: 2018年8月21日 23:58 To: cisco/openh264 openh264@noreply.github.com Cc: Chen Zhang -X (chezhan3 - CIIC at Cisco) chezhan3@cisco.com; Mention mention@noreply.github.com Subject: Re: [cisco/openh264] cavlc+bframe decode error (#3013)

@chezhan3https://github.com/chezhan3 Right, I did not implement cavlc b-frame and thought it is not being used so often. Fortunately most implementations of cabac b-frame decoding are the same as those of cavlc b-frame decoding. It is much simpler than cabac b-frame. one developer @centricular.com had interest in continuing the effort and I told him that the cavlc-frame decoding is currently missing.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/cisco/openh264/issues/3013#issuecomment-414725919, or mute the threadhttps://github.com/notifications/unsubscribe-auth/Ak-j7vc3vKq1LucWbR0XVkP6CNSSoPwiks5uTC37gaJpZM4WFWhT.

thaytan commented 5 years ago

Latest git master decodes all 9 frames in Cisco_Adobe_PDF_sample_a_1024x768_CAVLC_Bframe_9.zip