You are on page 1of 54

MSM8x12/MSM8x10 Linux Android™ Video

Overview
80-NC839-9 H

Confidential and Proprietary – Qualcomm Technologies, Inc.


Restricted Distribution: Not to be distributed to anyone who is not an employee of either Qualcomm or its subsidiaries without the express approval of Qualcomm’s Configuration Management.
Confidential and Proprietary – Qualcomm Technologies, Inc.

Confidential and Proprietary – Qualcomm Technologies, Inc.


NO PUBLIC DISCLOSURE PERMITTED: Please report postings of this document on public servers or websites to: DocCtrlAgent@qualcomm.com.
Restricted Distribution: Not to be distributed to anyone who is not an employee of either Qualcomm or its subsidiaries without the express approval of Qualcomm’s
Configuration Management.
Not to be used, copied, reproduced, or modified in whole or in part, nor its contents revealed in any manner to others without the express written permission of
Qualcomm Technologies, Inc.
Qualcomm reserves the right to make changes to the product(s) or information contained herein without notice. No liability is assumed for any damages arising directly
or indirectly by their use or application. The information provided in this document is provided on an “as is” basis.
This document contains confidential and proprietary information and must be shredded when discarded.
Qualcomm is a trademark of QUALCOMM Incorporated, registered in the United States and other countries. All QUALCOMM Incorporated trademarks are used with
permission. Other product and brand names may be trademarks or registered trademarks of their respective owners.
This technical data may be subject to U.S. and international export, re-export, or transfer (“export”) laws. Diversion contrary to U.S. and international law is strictly
prohibited.
Qualcomm Technologies, Inc.
5775 Morehouse Drive
San Diego, CA 92121
U.S.A.
© 2012-2013 Qualcomm Technologies, Inc.
All rights reserved.

PAGE 2 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Revision History

Revision Date Description

A Dec 2012 Initial release

B Mar 2013 Updated slide 8, 9, and 13, added section for Detailed Codec Features

C Apr 2013 Removed encoder slicing support in slides 36 and 37

D Jun 2013 Added Detailed Codec Supported Configurations slides

E Aug 2013 Updated Detailed Codec Supported Configurations slides and updated title to include
MSM8x12
F Sep 2013 Updated Codec supported configurations, memory requirement details, troubleshooting
slides, and call flows; added Color Format, Test Application, and Crash Dumps
Collection Using QPST slides
G Oct 2013 Updated Detailed Codec Supported Configurations on 8x10/8x12, Performance, Color
Format, Crash Dumps Collection Using QPST, and Codec Features slides
H Nov 2013 Updated slide 10, and added slide 40 for Capturing Input Bitstream and Output YUV

PAGE 3 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Contents

 Introduction
 Hardware Architecture
 Software Architecture
 Call Flows
 Color Format/Memory Requirements
 Troubleshooting
 Licensee Responsibilities and Recommendations
 Detailed Codec Features
 References
 Questions?

PAGE 4 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Introduction

PAGE 5 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Introduction

 At the end of this presentation, you will understand:


 MSM8x12/8x10 video specifications
 Hexagon™ video solution
 Supported codecs and their profiles
 MSM8x12/8x10 video design for Android™
 Video software architecture
 Memory usage
 Debugging
 This presentation is applicable to the following chipsets:
 MSM8x10
 MSM8x12

PAGE 6 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Hardware Architecture

PAGE 7 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Overview

 Video codecs run on Hexagon,


completely firmware-based
 Hexagon – 32/32/256k caches,
500 MHz (691 MHz+turbo)

PAGE 8 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Detailed Codec Supported Configurations on 8x10/8x12

 Decoder
Codec Profile Level Max resolution Max FPS Max bitrate (Mbps)
720p
Baseline 3.1 30 4
(1280x720)
1080p
Baseline 4 24 4
H.264 (1920x1080)
Main 3.1 720p 30 4

High 3.1 720p 30 4

Simple 6 720p 30 4
MPEG-4
Advanced simple 5 720p 30 4
FWVGA
H.263 Profile 0 70 30 3
(864x480)
Simple FWVGA 30 3
WMV-9
Main FWVGA 30 3

Simple ML FWVGA 30 3
VC1
Main ML FWVGA 30 3

DivX 4x, 5x, 6x Mobile 720p 30 4

Xvid 720p 30 4

On2 VP8 FWVGA 30 3

HEVC Main FWVGA 30 2

PAGE 9 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Detailed Codec Supported Configurations on 8x10/8x12 (cont.)

 Encoder
Codec Profile Level Max resolution fps Bitrate (Mbps)
FWVGA
Baseline 3 30 3
(864x480)
H.264
720p
Baseline 3.1 30 6*
(1280x720)
MPEG-4 Simple 5 FWVGA 30 3

H.263 0 70 FWVGA 30 3

Notes
• H.264 (720p, 30fps, and 6 Mbps) clips encoded with Hexagon will play fine irrespective of H264
decoder (720p, 24fps, and 4 Mbps) specification
• See slide 47 for H.264 FWVGA vs H.264 720p supported features/tools
• On MSM8610.LA.1.0 for H.264 720p@30fps, 6 Mbps encoding support is added from post-CS3
builds dated Nov 15th, 2013

PAGE 10 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Software Codec Supported Configuration on 8x12

 Decoder
Codec Profile Level Max resolution fps Bitrate (Mbps)
Simple/Advanced 1080p
MPEG-4 6/5 30 6
Simple (1920x1080)

Note: For lower resolution, QDSP6 decoder is used.

PAGE 11 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Performance

Feature Support
Multiple decoder instances 2 decoders; total number of MBs not to exceed 720p @ 30 fps
(applicable only to H264 and MPEG4)
2 decoders; total number of MBs not to exceed FWVGA @ 30 fps
(applicable only to VC1 and VP8)
Simultaneous decode encode Up to HVGA @ 30 fps

Decoder output color format NV12, NV21


Encoder input color format

PAGE 12 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Software Architecture

PAGE 13 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Video on Hexagon

 Uses V4L2 driver and msm-vidc


modules common on latest
MSM™ chipsets
 Host Firmware Interface (HFI)
translates communication packets
for Hexagon
 Codecs run on DSP
 Rest of the data flow and A/V sync
managed by the application CPU
 Memory is managed by using both
SMMU and internal Hexagon
MMU

Hexagon
Hexagon
MMU

PAGE 14 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Component Description

 OMX video decoder/encoder components


 Wraps the functionality of the component required in the target system; OMX IL
provides the standard interface for the function being wrapped; suited for V4L2
interface
 V4L2 framework/interface
 Video4Linux (second version) is a video API and framework for Linux; provides
event, callbacks, buffer management
 msm_vidc
 Common driver for encoder and decoder; implements kernel APIs that will talk
to under-layer hardware; maintains state transitions, instance count, codec
checks
 HFI
 Generates communication packets to Hexagon, translates messages from
Hexagon, and interacts with Asynchronous Packet Router (APR) for Host-DSP
communication

PAGE 15 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Source Code Layout

 Stagefright
 /frameworks/av/media/libstagefright
 OMX IL components
 /hardware/qcom/media/mm-video-v4l2/vidc/
 OMX core
 /hardware/qcom/media/mm-core
 V4l2 framework code
 kernel/drivers/media/video/ (file prefix will be videobuf2)
 MSM video driver files
 kernel/drivers/media/platform/msm/vidc/
 HFI
 /kernel/drivers/media/platform/msm/vidc/*hfi*
 Device tree
 /kernel/arch/arm/boot/dts

Note: * means that filenames can have any string before or after.

PAGE 16 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Video HFI Architecture

Hexagon

PAGE 17 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Hexagon HFI

 Video driver exposes a common HFI interface for a range of MSM chipsets
 For MSM8x10, Q6_HFI instance will be created based on “hfi” device tree entry
 msm_vidc registers a callback with HFI to be notified on command
response/events from video hardware
 Callback executes in APR callback thread context
 HFI_packetization module creates command packets to send to video
hardware
 HFI_response_handler module deciphers response from the video hardware
and packages it to msm_vidc readable format
 HFI_Q6 performs specific packet wrapping for communication with Hexagon
 HFI_Q6 interacts with Hexagon video core through packets sent through APR
layer, by calling apr_send_pkt()
 HFI_Q6 registers itself as a client with APR and provides a response handler
callback function
 APR communicates to Hexagon through shared memory driver
 Once Hexagon has processed the command, it will send the response back
to APR
 APR layer will invoke the registered callback function to inform HFI_Q6

PAGE 18 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Call Flows

PAGE 19 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Call Flow Decoder – Driver Configuration

Multimedia OpenMAX V4L2 Video Ion Kernel


Hexagon
Framework Comp Driver Framework
GetHandle
Open(/dev/video/q6_dec)
Allocate interface Queues
HFI_CMD_SYS_INIT
HFI_MSG_SYS_INIT_DONE
Open return

Enum formats
VIDIOC_S_FMT(inputPort)
HFI_CMD_SESSION_INIT
HFI_MSG_SESSION_INIT_DONE
Return VIDIOC_S_FMT(inputPort)
GetHandle return (Loaded_state)
Get_parameter(OMX_IndexParamVideoInit)

Get_parameter(OMX_IndexParamPortDefinition)
VIDIOC_REQBUFS(inputPort)
HFI_CMD_GET_PROPERTY(get buffer requirements)
HFI_CMD_GET_PROPERTY_DONE
Return VIDIOC_REQBUFS(inputPort)

Get_parameter(OMX_IndexParamVideoPortFormat)

Enumerate buffer formats


supported on output port

Set_parameter(OMX_IndexParamVideoPortFormat)
VIDIOC_S_FMT(outputPort)
HFI_CMD_SET_PROPERTY
Return VIDIOC_S_FMT (outputPort)

Set_parameter(OMX_IndexParamVideoPortFormat)

Get_parameter(OMX_IndexParamPortDefinition)

VIDIOC_REQBUFS(outputPort)
HFI_CMD_GET_PROPERTY(get buffer requirements)
HFI_CMD_GET_PROPERTY_DONE
Return VIDIOC_REQBUFS(outputPort)

Get_parameter(OMX_IndexParamPortDefinition)

PAGE 20 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Call Flow Decoder – Executing

Multimedia OpenMAX V4L2 Video Ion Kernel


Hexagon
Framework Comp Driver Framework

SendCommand(EXECUTING)

VIDIOC_STREAMON(outputPort)

Stream on to be called on both


ports to send the start command
to Venus core.

Command complete EXECUTING

EmptyThisBuffer

VIDIOC_QBUFS(inputPort) Call stream ON for the first empty


buffer, this results in start
command to core

VIDIOC_STREAMON(first buffer only)

HFI_CMD_LOAD_RESOURCES

HFI_MSG_LOAD_RESOURCES_DONE

HFI_CMD_START

HFI_CMD_START_DONE

Return VIDIOC_STREAMON (first bufferonly)

PAGE 21 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Call Flow Decoder – Executing (cont.)

Multimedia OpenMAX V4L2 Video Ion Kernel


Hexagon
Framework Comp Driver Framework
Map into Venus IOVA

HFI_CMD_SESSION_EMPTY_BUFFER

EVT_PORT_Dimension change Capture HFI_MSG_EVT_NOTIFY(SEQUENCE_CHANGED)


EventPort Settings changed
SendCommand(Portdisable output) VIDIOC_STREAMOFF (outputPort) HFI_CMD_SESSION_FLUSH(Output)
HFI_MSG_SESSION_FLUSH_DONE
HFI_CMD_UNLOAD_RESOURCES
HFI_MSG_UNLOAD_RESOURCES_DONE
HFI_CMD_SESSION_STOP
HFI_MSG_STOP_DONE
Return VIDIOC_STREAMOFF (outputPort)

Return all the flushed output


buffers to IL client

Command Complete (Disable done)


Get_Parameter
(OMX_IndexPortDefinition)
VIDIOC_REQBUFS (outputPort) HFI_CMD_SESSION_GET_PROPERTY (Buffer requirements)

Return VIDIOC_REQBUFS (outputPort) HFI_MSG_PROPERTY_DONE


Return
Get_Parameter(OMX_IndexPortDefinition)

SendCommand(PortEnable Output)

Component will be in Enable


Pending state until all the required
output buffers allocated

Allocate/use buffer (OUTPUT)


Allocate output buffer from Ion (only in allocate buf model)

VIDIOC_QBUFS (outputPort)
Map into Venus IOVA
HFI_CMD_SESSION_SET_BUFFERS
Return VIDIOC_QBUF (outputPort)
Allocate buffer return

PAGE 22 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Call Flow Decoder – Executing (cont.)

Multimedia OpenMAX V4L2 Video Ion Kernel


Hexagon
Framework Comp Driver Framework

Allocate/use buffer (OUTPUT)

VIDIOC_QBUFS (outputPort)
Map into Venus IOVA

HFI_CMD_SESSION_SET_BUFFERS

Return VIDIOC_QBUF (outputPort)

Allocate buffer return


All output buffers allocated send
stream on for capture port for the
last output buffer

VIDIOC_STREAMON(outputPort)

HFI_CMD_LOAD_RESOURCES

HFI_MSG_LOAD_RESOURCES_DONE

HFI_CMD_START

HFI_CMD_START_DONE

Return VIDIOC_STREAMON (outputPort)

Command complete ENABLE done

PAGE 23 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Call Flow Decoder – Data Processing

Multimedia OpenMAX V4L2 Video Ion Kernel


Hexagon
Framework Comp Driver Framework

FillThisBuffer

VIDIOC_QBUFS(outputPort)

Map into Venus IOVA

HFI_CMD_SESSION_FILL_BUFFER

VdecMsg Thread blocking on poll


that will be unblocked when poll
return

HFI_MSG_SESSION_EMPTY_BUFFER_DONE

Input buffer Done event

VIDIOC_DQBUFS(inputPort)

Return VIDIOC_DQBUF (inputPort)

Empty_buffer_done
HFI_MSG_SESSION_FILL_BUFFER_DONE

output buffer Done event

VIDIOC_DQBUFS(outputPort)

Return VIDIOC_DQBUF (outputPort)

Fill Buffer Done

PAGE 24 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Call Flow Decoder – Tear Down

Multimedia OpenMAX V4L2 Video Ion Kernel


Hexagon
Framework Comp Driver Framework

SendCommand(IDLE)

VIDIOC_STREAM_OFF (outputPort)

HFI_CMD_SESSION_FLUSH

HFI_MSG_FLUSH_DONE

HFI_CMD_UNLOAD_RESOURCES

HFI_MSG_UNLOAD_RESOURCES_DONE

HFI_CMD_SESSION_STOP

HFI_MSG_STOP_DONE

Return VIDIOC_STREAMOFF (outputPort)

VIDIOC_STREAMOFF (inputPort)

Return VIDIOC_STREAMOFF (inputPort)

Return of IDLE call

PAGE 25 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Call Flow Encoder – Driver Configuration

Multimedia OpenMAX V4L2 Video Ion Kernel


Hexagon
Framework Comp Driver Framework
GetHandle
Open(/dev/video/q6_enc)
Allocate interface Queues
HFI_CMD_SYS_INIT
HFI_MSG_SYS_INIT_DONE
Open return

Enum formats
VIDIOC_S_FMT(outputPort)
HFI_CMD_SESSION_INIT
HFI_MSG_SESSION_INIT_DONE
Return VIDIOC_S_FMT(outputPort)
GetHandle return (Loaded_state)
Get_parameter(OMX_IndexParamVideoInit)

Get_parameter(OMX_IndexParamPortDefinition)
VIDIOC_REQBUFS(outputPort)
HFI_CMD_GET_PROPERTY(get buffer requirements)
HFI_CMD_GET_PROPERTY_DONE
Return VIDIOC_REQBUFS(outputPort)

Get_parameter(OMX_IndexParamVideoPortFormat)

Enumerate buffer formats


supported on Output port

Set_parameter(OMX_IndexParamVideoPortFormat)
VIDIOC_S_FMT(inputPort)
HFI_CMD_SET_PROPERTY
Return VIDIOC_S_FMT (inputPort)

Set_parameter(OMX_IndexParamVideoPortFormat)

Get_parameter(OMX_IndexParamPortDefinition)

VIDIOC_REQBUFS(inputPort)
HFI_CMD_GET_PROPERTY(get buffer requirements)
HFI_CMD_GET_PROPERTY_DONE
Return VIDIOC_REQBUFS(inputPort)

Get_parameter(OMX_IndexParamPortDefinition)

PAGE 26 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Call Flow Encoder – Configuration

Multimedia OpenMAX V4L2 Video Ion Kernel


Hexagon
Framework Comp Driver Framework

Set_parameter(OMX_IndexParamV ideoPortFormat)

VIDIOC_S_CTRL(outputPort)

HFI_CMD_SET_PROPERTY/HFI_SET_PROPERTY

Return VIDIOC_S_CTRL(outputPort)

Set_parameter(OMX_IndexParamV ideoPortFormat)

Set_parameter(OMX_IndexParamV ideoPortFormat)

VIDIOC_S_CTRL(outputPort)

HFI_CMD_SET_PROPERTY/HFI_SET_PROPERTY

Return VIDIOC_S_CTRL(outputPort)

Set_parameter(OMX_IndexParamV ideoPortFormat)

PAGE 27 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Call Flow Encoder – Buffer Allocation

Multimedia OpenMAX V4L2 Video Ion Kernel


Hexagon
Framework Comp Driver Framework

Send_command(IDLE)

Allocate/use buffer (INPUT)

Allocate input buffer from ION (only in allocate buf model)

VIDIOC_PREPAREBUFS(inputPort)
Map into Venus IOVA

HFI_CMD_SESSION_SET_BUFFERS
Return VIDIOC_PREPAREBUFS(inputPort)

Allocate buffer return

Allocate/use buffer (OUTPUT)

Allocate output buffer from ION (only in allocate buf model)

VIDIOC_PREPAREBUFS(outputPort)

Map into Venus IOVA

HFI_CMD_SESSION_SET_BUFFERS

Return VIDIOC_PREPAREBUFS(outputPort)

Allocate buffer return

All input/output buffers allocated


move to IDLE state

Command complete (IDLE done)

PAGE 28 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Call Flow Encoder – Executing

Multimedia OpenMAX V4L2 Video Ion Kernel


Hexagon
Framework Comp Driver Framework

SendCommand(EXECUTING)

VIDIOC_STREAMON(outputPort)

Stream on to be called on both


ports to send the start command
to Venus core

Command complete EXECUTING

EmptyThisBuffer

VIDIOC_QBUFS(inputPort) Call stream ON for the first empty


buffer, this results in start
command to core

VIDIOC_STREAMON(first buffer only)

HFI_CMD_LOAD_RESOURCES

HFI_MSG_LOAD_RESOURCES_DONE

HFI_CMD_START

HFI_CMD_START_DONE

Return VIDIOC_STREAMON (first bufferonly)

PAGE 29 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Call Flow Encoder – Data Processing

Multimedia OpenMAX V4L2 Video Ion Kernel


Hexagon
Framework Comp Driver Framework

FillThisBuffer

VIDIOC_QBUFS(outputPort)

HFI_CMD_SESSION_EMPTY_BUFFER

HFI_CMD_SESSION_FILL_BUFFER
VdecMsg Thread blocking on poll
that will be unblocked when poll
HFI_MSG_SESSION_EMPTY_BUFFER_DONE
return

Input buffer Done Event

VIDIOC_DQBUFS(inputPort)

Return VIDIOC_DQBUFS(inputPort)

Empty_buffer_done

HFI_MSG_SESSION_FILL_BUFFER_DONE

output buffer Done Event

VIDIOC_DQBUFS(outputPort)

Return VIDIOC_DQBUFS(outputPort)

Fill Buffer Done

EmptyThisBuffer

VIDIOC_QBUFS(inputPort)

HFI_CMD_SESSION_EMPTY_BUFFER

PAGE 30 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Call Flow Encoder – Tear Down

Multimedia OpenMAX V4L2 Video Ion Kernel


Hexagon
Framework Comp Driver Framework

SendCommand(IDLE)

VIDIOC_STREAMOFF(outputPort)

HFI_CMD_SESSION_FLUSH

HFI_MSG_FLUSH_DONE

HFI_CMD_UNLOAD_RESOURCES

HFI_MSG_UNLOAD_RESOURCES_DONE

HFI_CMD_SESSION_STOP

HFI_MSG_STOP_DONE

Return VIDIOC_STREAMOFF(outputPort)

Return of IDLE call

PAGE 31 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Color Format/Memory Requirements

PAGE 32 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Color Format

PAGE 33 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Memory Footprint Decoder

1080p (baseline) 720p (high)


H.264 decoder Smooth
Normal Normal
streaming
Number of input buffers 3 6 6

Input buffer size ~2 MB ~0.9 MB ~0.9 MB

Number of output buffers 8 8 19

Output buffer size ~3 MB ~1.35 MB ~1.35 MB

Internal 35.37 MB 19.3 MB 19.3 MB

Total 65.26 MB 35.48 MB 50.37 MB

Resolution W1 W2 H1 H2 H3 H4 nAllocSize

720p 1280 1280 720 736 368 1104 1413120 bytes


(1280x720) (~1.35 MB)
1080p 1920 1920 1080 1088 544 1632 3133440 bytes
(1920x1080) (~3 MB)

Refer page 33 for W1-W2, H1-H4 details

PAGE 34 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Memory Footprint Encoder

MPEG4
Encoder H.264 720p (baseline)
(FWVGA)

Number input buffers 9 9

Input buffer size 1437696 bytes 1437696 bytes

Number output buffers 4 4

Output buffer size 692224 bytes 322560 bytes

Internal 14970880 bytes 17023504 bytes

Total 29.24 MB 29.79 MB

PAGE 35 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Troubleshooting

PAGE 36 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Debugfs for msm_vidc

 Debugfs is a simple way for kernel developers to make information


available to the user space
 Structure

\d\msm_vidc\debug_level (default 3)
\d\msm_vidc\core0\info
\d\msm_vidc\core0\instance_<0..N>\info

 Usage
adb shell mount -t debugfs none /d
@android:/d/msm_vidc/core0/inst_ec024000 # cat info

 Core instance information will be displayed


 Height
 Width
 Codec
 Color
 Plane size
PAGE 37 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Video Driver Debugging

 dprintk()
 Messages will be in kernel logs depending on message debug level
 Depending on debug level, log messages will be printed
VIDC_ERR = 0x0001
VIDC_WARN = 0x0002
VIDC_INFO = 0x0004
VIDC_DBG = 0x0008
VIDC_PROF = 0x0010
 Other levels messages are activated by bitmask of debugfs
\d\msm_vidc\debug_level (default 0x03)
 Kernel messages viewing
adb shell cat /proc/kmsg

PAGE 38 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
How to Enable Debug Logs

 User space
 OMX component logs can be enabled using setprop “vidc.debug.level”
 Default debug level is set to 3
 Depending on debug level, log messages will be printed
PRIO_ERROR=0x1
PRIO_HIGH=0x2
PRIO_LOW=0x4
 Usage
adb shell setprop vidc.debug.level <debug-level>

PAGE 39 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Capturing Input Bitstream and Output YUV

 Input bitstream dump


 Setting the “vidc.dec.log.in” to 1 will enable bitstream dump
 Dump is available at /data/misc/media
 Usage
 adb shell setprop vidc.dec.log.in 1
 Output YUV dump
 Setting the “vidc.dec.log.out” to 1 will enable YUV dump
 Dump is available at /data/misc/media
 Usage
 adb shell setprop vidc.dec.log.out 1

PAGE 40 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Test Application

Decoder
 Run in the adb shell
 mm-vdec-omx-test <input file> (input file should only be in the form of the video
bitstream and not the file container)
 Follow onscreen instructions
 Save YUV log option stores output in file system
 Example
mm-vdec-omx-test /sdcard/MPEG4_qvga_30fps_384kbps_90s.m4v

PAGE 41 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Test Application (cont.)

 Encoder
 In the adb shell, run mm-venc-omx-test720p
 Usage
 /mm-venc-omx-test720p FILE <RESOLUTION> <MP4|H263 <FPS> <BITRATE>
<NFRAMES > <INFILE> <OUTFILE> <Rate Control - optional>
 RESOLUTION – WidthxHeight
 BITRATE – Bitrate in kbps
 FPS – Frames per second
 NFRAMES – Number of frames to play, 0 for infinite
 RateControl (values 0 to 4 for RC_OFF, RC_CBR_CFR, RC_CBR_VFR, RC_VBR_CFR,
RC_VBR_VFR)
 Example

mm-venc-omx-test720p FILE 352x288 H263 15 1000 30


/sdcard/foreman.yuv /sdcard/foreman.263 0

PAGE 42 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Crash Dumps Collection Using QPST

1. Ensure that the QPST version is 2.7 build 397 or later.


2. When the phone resets/crashes and enters Download mode/Sahara
mode, the device enumerates as QCT/XXX Sahara.
3. The RAM dump download starts automatically. Wait for approximately 10
min for the progress bar in QPST to finish.
4. In QPST, select Help→Open Log File Directory to see the path where the
crash dump was saved.
5. Copy the RAM dump to a different directory and share the crash dumps
so that the crash dumps can be analyzed.

PAGE 43 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Licensee Responsibilities and
Recommendations

PAGE 44 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Licensee Responsibilities and Recommendations

 Responsibilities
 Integration of OMX IL for the decoder and encoder if the standard media
framework supported by Android is not used

PAGE 45 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Detailed Codec Features

PAGE 46 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Codec Features

Features H264-FWVGA-Encode H264-720p-Encode

Deblocking Available Disabled


Boundary strength calculation for DB Available Disabled
Sub-pel search in ME Available Disabled
Sub-pel plane generation in DB Available Disabled
Basic SAD unit 8x8 16x16
I 4x4 in Spatial Estimation (SE) Available Disabled
I 16x16 in SE Available Available
16x16 partition in ME Available Available
8x8, 16x8, 8x16 partition in ME Available Disabled
Integer pel search in ME Available Available
DCT, IDCT, quantization, inverse quantization, and VLC Available Available

PAGE 47 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Codec Features (cont.)

Codec Supported/unsupported features and other features


H264-Dec  H.264 decoder supported features:
 Baseline profile
 I-slice
 P-slice
 CAVLC
 Constrained intraprediction
 4:2:0
 Luma/chroma bit depth 8
 VUI/SEI parsing
 Main profile – Baseline profile plus:
 B-slice
 CABAC
 Weighted prediction
 High profile – Main profile plus:
 Quantization matrix
 Transform 8x8
 H.264 decoder unsupported features:
 Baseline profile
 ASO
 FMO
 Monochrome 4:0:0
 Redundant slices
 Main profile – Baseline profile plus:
 Interlaced
 MBAFF

PAGE 48 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Codec Features (cont.)

Codec Supported/unsupported features and other features


MPEG4-Dec, H263-Dec  MPEG-4/H.263 decoder supported features:
 Simple profile
 I-VOPs
 P-VOPs
 Short header (H.263 compatibility)
 4 motion vectors per MB
 Unrestricted motion vectors
 Intraprediction, i.e., inverse DC and AC prediction
 Video packets (slices)
 Data partitioning
 Reversible VLCs
 Advanced simple profile
 B-VOPs
 Alternate quantizer
 MPEG-4/H.263 decoder unsupported features:
 Advanced simple profile
 Interlacing
 Global motion compensation
 Quarter-pixel motion compensation

PAGE 49 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Codec Features (cont.)

Codec Supported/unsupported features and other features


VC1-Dec  VC1 decoder supported features:
 Simple profile
 Baseline intraframe compression
 Variable-sized transform
 Transform specification
 Overlapped transform
 4 motion vectors per macro block
 Quarter-pixel motion compensation Y
 Main profile – Simple profile plus:
 Quarter-pixel motion compensation Cb, Cr
 Extended motion vectors
 Loop filter
 Adaptive macro block quantization
 Bidirectional (B) frames
 Intensity compensation
 VC1 decoder unsupported features:
 Main profile
 Range adjustment
 Start codes
 Dynamic resolution change
 Advanced profile
 Not supported
Vp8-Dec All features supported
PAGE 50 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Codec Features (cont.)

Codec Supported/unsupported features and other features


Common to all decoders  Error concealment
 Gray concealment and also color fill from client
 Seek to non-I frame
 Slice level concealment
 Non-Mod 16 decode
H264-Enc  H.264 encoder supported features:
 Baseline profile
 I-slice
 P-slice
 CAVLC
 4:2:0
 Luma/chroma bit depth 8
 H.264 encoder unsupported features:
 Baseline profile
 ASO
 FMO
 Monochrome 4:0:0
 Redundant slices
 Other features
 Rate control (MB-level, skip MBs, skip frames)
 IDR request
 Intrarefresh modes (cyclic and random)
 Extradata
 Intraperiod

PAGE 51 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Codec Features (cont.)

Codec Supported/unsupported features and other features


MPEG4-Enc/H263 Enc  MPEG-4/H.263 encoder supported features:
 Simple profile
 I-VOPs
 P-VOPs
 Short header (H.263 compatibility)
 4 motion vectors per MB
 Intra prediction, i.e., inverse DC and AC prediction
 Video packets (slices)
 MPEG-4/H.263 encoder unsupported features
 Simple profile
 Data partitioning
 Reversible VLCs
 Other features
 Rate control (MB-level, skip MBs, skip frames)
 I-VOP request
 Intrarefresh modes (cyclic and random)
 Extradata
 Intraperiod (GOP)

PAGE 52 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
References

Ref. Document

Qualcomm Technologies
Q1 Application Note: Software Glossary for Customers CL93-V3077-1

Q2 OpenMAX Integration Layer Video Integration Guide for Linux 80-VT322-1


and Android
Q3 OpenMAX Integration Layer Video Encoder for Linux and Android™ 80-N1933-1

Standards
S1 OMX IL Interface Specification http://www.khronos.org/openmax/

PAGE 53 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Questions?
https://support.cdmatech.com

PAGE 54 80-NC839-9 H Nov 2013 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION

You might also like