• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Embedded Software » Multimedia Software Codecs » Multimedia Software Codecs forum » How to improve H.264 performance (baseline profile, res=640x480)?
Share
Multimedia Software Codecs
  • Forum
Options
  • Subscribe via RSS

Forums

How to improve H.264 performance (baseline profile, res=640x480)?

  • Rohan Babtiwale
    Posted by Rohan Babtiwale
    on Apr 02 2012 01:53 AM
    Prodigy160 points

    Hi,

    I am using H.264 codec to encode video on DM368. I want constant bit rate of 512K maximum.

    The performance is okay with the still image but it degrades with the moving picture. There are blocks (pixalization) in the video stream.

    At 2M bit rate the performance is good. But I want a better picture quality at 512K.

    I have attached captured video in this post.

    Click here to play this video

    How can I improve image quality without increasing the bit rate??

    I am using dvsdk_4_02_00_06.

    here are the parameters i have set currently,

    encodingPreset                                          = XDM_HIGH_SPEED

    rateControlPreset                                       = IVIDEO_LOW_DELAY;// constant bit rate
    videncParams.maxWidth                          = 640;
    videncParams.maxHeight                         = 480;
    videncParams.maxFrameRate                 = 30000;
    videncParams.maxBitRate                        = 512K;
    videncParams.dataEndianness                = XDM_BYTE;
    videncParams.maxInterFrameInterval     = 1; //As per TI h264 enc document
    videncParams.inputChromaFormat         = XDM_YUV_420SP;
    videncParams.inputContentType             = IVIDEO_PROGRESSIVE;
    videncParams.reconChromaFormat        = XDM_YUV_420SP;
    profileIdc                                                        = 66;
    levelIdc                                                           = IH264VENC_LEVEL_30;
    entropyMode                                                 = 0; //For base profile CAVLC should only be used
    meAlgo                                                           = 1;
    enableVUIparams                                        = 0;
    transform8x8FlagIntraFrame                      = 0;
    transform8x8FlagInterFrame                      = 0;
    seqScalingFlag                                             = 0;
    encQuality                                                      = XDM_HIGH_SPEED
    enableARM926Tcm                                     = 0;

    Dynamic paraeters----

    videncDynamicParams.inputWidth                = 640
    videncDynamicParams.inputHeight               = 480
    videncDynamicParams.targetBitRate            = 512K
    videncDynamicParams.intraFrameInterval   = 30;
    videncDynamicParams.generateHeader      = XDM_ENCODE_AU;
    videncDynamicParams.captureWidth            = 0;
    videncDynamicParams.interFrameInterval   = 0;

    videncDynamicParams.targetFrameRate     = 30000;
    videncDynamicParams.refFrameRate           = 30000;

    I am sending an "I frame" after every 30 'P frames'.

    Codec codecs DaVinci DM368 dm365 + h264 dm365 codec encoder h264 platinum DM365 Encoder DM365 H264 decoder/Encoder DM365 H264 Encoder dm365 h264 platinum codec extended parameters DM365 H264 Platinum Encoder DM365 Platinum Encoder dm365-codecs DM36x encode encoder H.264 H.264 Encoder h264 H264 Encoder h264enc
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Veeranna Hanchinal
    Posted by Veeranna Hanchinal
    on Apr 02 2012 02:05 AM
    Expert5345 points

    Hi Rohan,

    If speed is not an issue for you, please use encodingPreset = USER_DEFINED and encQuality=1. You can also choose different rate control mode depending upon your sequence.

    please have a look at different rate control algos avaialbe at http://processors.wiki.ti.com/index.php/DM36x_Rate_Control_Modes

    Hope you are using latest encoder(02.30.00.04) if not please get it from http://software-dl.ti.com/dsps/dsps_public_sw/codecs/DM36x/index_FDS.html

    Thanks,

    Veeranna

    DM365 H264 Encoder
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Adithya Banninthaya
    Posted by Adithya Banninthaya
    on Apr 02 2012 02:36 AM
    Intellectual1930 points

    Rohan,

    Apart from what Veeranna has suggested, can you also use high profile encoder instead of baseline profile. With high profile, you can use tools like CABAC  (entropyMode), transform8X8 and sequence scaling flag which improves the quality.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Rohan Babtiwale
    Posted by Rohan Babtiwale
    on Apr 03 2012 07:20 AM
    Prodigy160 points

    Hi

    Thanks for the quick reply.

    I changed the encoder version to "dm365_h264enc_02_30_00_03_production"

    Here are some changes which I made in the parameters,

    encodingPreset           = XDM_USER_DEFINED
    rateControlPreset        = IVIDEO_USER_DEFINED

    encQuality                    = 0         //  To enable perpetualRC  ----- please comment on this----- how encQuality  makes difference ??

    Also modified some extended dynamic parameters

    rcAlgo                            = 1;
    maxDelay                     = 5000;
    initQ                               = -1;
    rcQMaxI                        = 36;

    The picture quality is increased but still there is some pixalization and picture sharpness is not as good as I would like.

    Are these parameter settings proper?

    Here is the latest encoded video.

    Click here to play this video

    What else can be done to improve the picture clarity??

    Thanks,

    Rohan

    encoder encode h264 H264 Encoder h264enc H.264 dm365 + h264 DaVinci DM368 H.264 Encoder dm365-codecs DM368 DM365 Encoder DM365 H264 Encoder DM365 H264 decoder/Encoder
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Rohan Babtiwale
    Posted by Rohan Babtiwale
    on Apr 03 2012 07:26 AM
    Prodigy160 points

    Hi Adithya,

    Thanks for the quick reply

    I have to use baseline profile as this is a video phone application. So I cant use high profile and the other parameters which you mentioned.

    I have made some changes in the parameters. Please check the above post.

    Anything else I should look into??

    Thanks for help,

    Rohan

    encoder encode h264 H264 Encoder h264enc H.264 dm365 + h264 DaVinci DM368 H.264 Encoder DM368 DM365 Encoder DM365 H264 Encoder DM365 H264 decoder/Encoder
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Veeranna Hanchinal
    Posted by Veeranna Hanchinal
    on Apr 04 2012 04:11 AM
    Expert5345 points

    Hi,

    Please set encQuality =1 and minQp = 8, maxQp = 42. You can also try different rcAlgos which suits your input sequence.

    And encQuality is the parameter which controls Encoder mode. It will have control over Quality and speed performance numbers.

    Thanks,

    Veeranna

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Rohan Babtiwale
    Posted by Rohan Babtiwale
    on Apr 08 2012 23:30 PM
    Prodigy160 points

    Hi,

    I have tried changing these parameters and few other parameters. But there is no apparent change in video quality. I am only concerned about the pixel blocks in the image and picture clarity when there is motion. Can you give me overall back ground of how to remove pixalization at lower bit rates.??

    I have another video phone product based on DM 6446. In this, encoder is dropping frames in case of a complex image keeping the bit rate constant. And the pixalization is negligible. But this is not happening in case of DM 368. Can we obtain this kind of behavior in DM368 based?? How??

    Thanks,

    Rohan

    encoder encode h264 H264 Encoder h264enc H.264 dm365 + h264 DaVinci DM368 DM6446 H.264 Encoder DM365 H264 PLATINUM DM368 DM365 H264 Platinum Encoder DM365 Encoder DM365 H264 Encoder
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Veeranna Hanchinal
    Posted by Veeranna Hanchinal
    on Apr 11 2012 07:01 AM
    Expert5345 points

    Hi Rohan,

    As you are using rcalgo = 1, frameskip will not happen. Can you please try by using rcalgo = 5 or rcalgo = 0 and try by changing LBRmaxpicsize to higher values.

    Thanks,

    Veeranna

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Veeranna Hanchinal
    Posted by Veeranna Hanchinal
    on May 10 2012 09:00 AM
    Expert5345 points

    Are you able to get desired Quality?

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Pradeep Acharya
    Posted by Pradeep Acharya
    on Sep 14 2012 07:21 AM
    Intellectual930 points

    Hi veeranna,

                         I'm also facing issues in tuning  in encoder for low bit rates like 512kbps (vga resolution). I tried to tune the parameters based on the above i/ps. I changed the encoder_frame_rate, dynamic target and reference frame  rate to 15000 i,,e 15pfs frame  variable frame rate hoping that the no of bits required per frame would be increased and thus can achieve better quality at constant bit rate rate. But to my observation, the encoding bit rate got doubled i,,e if bit rate is configured to 412 kbps then the o/p from encoder is between 800 - 830 kbps i,,e got doubled. the o/p bit rate is constant. if i reconfigure the frame rate to 30000 then the o./p bit rate from encoder is between 400 - 430 kbps.

                        I tried by configuring the rcAlgo to 0 and 5. The results are same for both these configurations. Why is it happening ? I was expecting that encoder would take care of skipping the frames and would generate more bits per frame in complex video (like movement of hand ). The quality of video is very bad when there is hand movement in front of camera. How to improve the quality in this scenario keeping the bit rate constant ? Does DM 368 encoder take care of frame skipping or the application should take care ?

     regards

    pradeep

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use