264 process of MFC decode H.264

Source: Internet
Author: User

The supported formats for Playing videos on your mid platform are limited. You need to expand more formats according to application requirements. 6410 self-contained MFC (multi format codec), supports hard decoding of MPEG4, h263, h264. Through LS-L/Dev, we can know that the driver module of the s3c-mfc has been loaded. In Android, the encoding and decoding part of the MFC is under the external/opencore/codecs_v2/Video/initi_mfc directory, initiate Io control. The .mp4 video file is stored in the SDK card and can indeed be played. The following describes the MFC workflow.

Kernel startup initialization:
(1) execute the command "Maid ()" and print "2007 Samsung Electronics ";
2) register the platform device platform_driver_register (& initi_driver). If the platform device is successfully registered, print "initi6400 MFC driver module init OK"

3) after the module has been loaded, it will start to enter the initi_mfc_probe ();

4) obtain the MFC clock, enable the MFC clock, and map the physical address of the register;

5) Access interruption and registration interruption;
6) Call mfc_memorysetup () to set SFr buffer, bitprocessor buffe (Code, work, para) R, data buffer (stream, YUV frame );

7) Call mfc_hw_init () to initialize the hardware;

1. Call mfcreset () to reset the mfc ip address;

2. Call mfcfirmware1_codebuf () to load the internal firmware of the MFC module;
3. Call mfcstartbitprocessor () to start bitprocessor;

4. Call mfcconfigsfr_bitproc_buf () to configure the address for the bitprocessor's master controller code, work, and para control registers;

5. Call mfcconfigsfr_ctrl_opts () to set other bitprocessor control registers;

8) disable the clock, set MFC to lp_mode, and enter the pending ready state;

When the upper-layer application starts to call H.264 Decode:
0) The upper layer calls the initi_mfc_open () method to open the MFC device;
1) Call mfcinst_create () to create an MFC instance. Multiple instances can be created;
2) The returned result is "initi_mfc_open: MFC open success", and "open" ends.

3) Call initi_mfc_ioctl, execute ioctl_mfc_get_line_buf_addr, and set line_buf or ring_buf;

4) Call initic_ioctl and execute ioctl_mfc_mpeg4_dec_init to initialize decoding. Get the length of the stream file and the width and height of the frame that outputs YUV.

5) Call initi_mfc_ioctl and execute ioctl_mfc_mpeg4_dec_exe for decoding. In the memory, decode the stream data of in Buf and assign it to the YUV frame of out Buf.

6) during video playback, the following call occurs repeatedly: ioctl_mfc_get_fram_buf_addr and ioctl_mfc_mpeg4_dec_exe;
7) Call mfcinst_delete to release the instance after decoding;

 

 

Reference: http://spaces.baidu.com/aokikyon/blog/category/6410

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.