vp8 decoding problems on IOS platform.

937 views
Skip to first unread message

Rahul Ganure

unread,
Dec 12, 2012, 4:45:57 AM12/12/12
to webm-d...@webmproject.org
Hello everyone,

I have used libvpx(1.1.0) source and created  xcode project to port vp8 codec on IOS platform. I have built a static library for armv7 architecture. 

Porject setting done is,

complier selected : Apple LLVM complier 4.1 (both for asm and c source)

complier flags passed during compiling ARM (GAS format) assembly files : -no-integrated-as

VP8 codec configuration:

1 Realtime encoding and decoding (VPX_DL_REALTIME)

2. CPU used = -6.

I have checked the codec operation on ipod touch, In debug mode encoding and decoding will be successful but the decoded video has colour and motion distortions.

While, with release mode static library, vp8 encoding will be successful but decoding fails.

I have also built the libvpx using configure script and and used libvpx.a here there is no such problem. can someone assist me some project setting for xcode that need to be done to create my own static library for IOS that can ran fine both in debug and release mode.

can someone help me on this,
Eagerly waiting for replies.

Regards,
Rahul.

Johann Koenig

unread,
Dec 12, 2012, 10:40:34 AM12/12/12
to webm-d...@webmproject.org
On Wed, Dec 12, 2012 at 1:45 AM, Rahul Ganure <rahul...@gmail.com> wrote:
> Hello everyone,
>
> I have used libvpx(1.1.0) source and created xcode project to port vp8
> codec on IOS platform. I have built a static library for armv7 architecture.

With or without NEON? I believe the 3GS and newer have support and
will benefit significantly from it.

> Porject setting done is,
>
> complier selected : Apple LLVM complier 4.1 (both for asm and c source)

What version of XCode?

Did you convert the assembly files? There is a script:
build/make/ads2gas_apple.pl

Did you generate the offset files? There are a number of manual steps
if you want to use XCode.

> complier flags passed during compiling ARM (GAS format) assembly files :
> -no-integrated-as
>
> VP8 codec configuration:
>
> 1 Realtime encoding and decoding (VPX_DL_REALTIME)
>
> 2. CPU used = -6.
>
> I have checked the codec operation on ipod touch, In debug mode encoding and
> decoding will be successful but the decoded video has colour and motion
> distortions.
>
> While, with release mode static library, vp8 encoding will be successful but
> decoding fails.
>
> I have also built the libvpx using configure script and and used libvpx.a
> here there is no such problem. can someone assist me some project setting
> for xcode that need to be done to create my own static library for IOS that
> can ran fine both in debug and release mode.

We recommend building independently and linking the resulting binary.
Are you having other issues? Is the assembly not working? Do you need
debugging?

Rahul Ganure

unread,
Dec 12, 2012, 11:57:31 PM12/12/12
to webm-d...@webmproject.org


On Wednesday, 12 December 2012 21:10:34 UTC+5:30, Johann wrote:
On Wed, Dec 12, 2012 at 1:45 AM, Rahul Ganure <rahul...@gmail.com> wrote:
> Hello everyone,
>
> I have used libvpx(1.1.0) source and created  xcode project to port vp8
> codec on IOS platform. I have built a static library for armv7 architecture.

With or without NEON? I believe the 3GS and newer have support and
will benefit significantly from it.

Hello Johann, 

Thank you for replying. 

I have complied in Xcode, by adding all the arm assembly files including neon assembly. I have taken complete source from libvpx after ./configure --target=armv7-darwin-gcc --enable-realtime-only -sdk-path=IOS_SDK_PATH --libc-path=LIBC_PATH.
 

> Porject setting done is,
>
> complier selected : Apple LLVM complier 4.1 (both for asm and c source)

What version of XCode?

Xcode version is 4.5 
IOS_SDK_VERSION = 6.0 
Complier Version  Apple LLVM complier 4.1

Did you convert the assembly files? There is a script:
build/make/ads2gas_apple.pl

Yes. I have used the gas converted assembly files. 

Did you generate the offset files? There are a number of manual steps
if you want to use XCode.

Yes, I have used generated  asm_enc_offsets.asm.s, asm_com_offsets.asm.s, vpx_config.h , vpx_config.asm and other files files in my xcode project.

Created static library for vp8 works fine in debug mode, but for release mode its not working.

Can you guide me with bit of help to overcome this problem. 

Any help is greatly appreciated.

Johann Koenig

unread,
Dec 13, 2012, 2:47:44 PM12/13/12
to webm-d...@webmproject.org
On Wed, Dec 12, 2012 at 8:57 PM, Rahul Ganure <rahul...@gmail.com> wrote:
> On Wednesday, 12 December 2012 21:10:34 UTC+5:30, Johann wrote:
> I have complied in Xcode, by adding all the arm assembly files including
> neon assembly. I have taken complete source from libvpx after ./configure
> --target=armv7-darwin-gcc --enable-realtime-only -sdk-path=IOS_SDK_PATH
> --libc-path=LIBC_PATH.

You may want to try a more recent checkout of libvpx. We're looking to
cut a new release soon. Current master branch should be stable for
your use. We improved Xcode detection. You no longer need to specify
the SDK path. We detect it using 'xcode-select'. However, if you are
building with something other than OS 5.1 you do need to specify
--libc=

Unit tests do not build correctly for iOS, so I've uploaded a patch to
disable them for now:
https://gerrit.chromium.org/gerrit/39656

My command line is:
../libvpx/configure --target=armv7-darwin-gcc
--libc=/Applications/Xcode.app//Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/
--disable-unit-tests

> Created static library for vp8 works fine in debug mode, but for release
> mode its not working.

You mentioned in your original message the Debug mode has image
quality issues and in Release that the decoder does not work at all.
Can you capture the stream and decode with another tool? Can you
decode static webm content on the device?

Rahul Ganure

unread,
Dec 14, 2012, 2:10:48 AM12/14/12
to webm-d...@webmproject.org

Rahul Ganure

unread,
Dec 14, 2012, 2:11:27 AM12/14/12
to webm-d...@webmproject.org


On Friday, 14 December 2012 01:17:44 UTC+5:30, Johann wrote:
On Wed, Dec 12, 2012 at 8:57 PM, Rahul Ganure <rahul...@gmail.com> wrote:
> On Wednesday, 12 December 2012 21:10:34 UTC+5:30, Johann wrote:
> I have complied in Xcode, by adding all the arm assembly files including
> neon assembly. I have taken complete source from libvpx after ./configure
> --target=armv7-darwin-gcc --enable-realtime-only -sdk-path=IOS_SDK_PATH
> --libc-path=LIBC_PATH.

You may want to try a more recent checkout of libvpx. We're looking to
cut a new release soon. Current master branch should be stable for
your use. We improved Xcode detection. You no longer need to specify
the SDK path. We detect it using 'xcode-select'. However, if you are
building with something other than OS 5.1 you do need to specify
--libc=

Unit tests do not build correctly for iOS, so I've uploaded a patch to
disable them for now:
https://gerrit.chromium.org/gerrit/39656

My command line is:
../libvpx/configure --target=armv7-darwin-gcc
--libc=/Applications/Xcode.app//Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/
--disable-unit-tests

Hello Johann,
Thanks for the support and the updated path that you have uploaded. 
 

> Created static library for vp8 works fine in debug mode, but for release
> mode its not working.

You mentioned in your original message the Debug mode has image
quality issues and in Release that the decoder does not work at all.
Can you capture the stream and decode with another tool? Can you
decode static webm content on the device?

I have worked on finding the reason behind the quality issue in debug mode  and decoding problems in release mode. I have found out that this sought of issue occur only I am setting any sought of optimisation level through xcode using apple LLVM complier 4.1

Moreover I have written the encoded stream in file for for both debug mode and release mode library by setting same input parameters and by feeding same input test data YUV file.

I have compared the encoded data files obtained form debug and release mode run, found that these files are not matching  when compared with a file compare tool Hex edit.

do we have any problems with vp8 codec when optimisation is enabled for IOS platform, because same code works fine even with optimisation level set on different platforms with their corresponding assembly source for each platform.

Johann Koenig

unread,
Dec 14, 2012, 1:42:08 PM12/14/12
to webm-d...@webmproject.org
On Thu, Dec 13, 2012 at 11:11 PM, Rahul Ganure <rahul...@gmail.com> wrote:
> On Friday, 14 December 2012 01:17:44 UTC+5:30, Johann wrote:
>> > Created static library for vp8 works fine in debug mode, but for release
>> > mode its not working.
>>
>> You mentioned in your original message the Debug mode has image
>> quality issues and in Release that the decoder does not work at all.
>> Can you capture the stream and decode with another tool? Can you
>> decode static webm content on the device?
>
> I have worked on finding the reason behind the quality issue in debug mode
> and decoding problems in release mode. I have found out that this sought of
> issue occur only I am setting any sought of optimisation level through xcode
> using apple LLVM complier 4.1

What sort of issue? Is this with libvpx built independently or in XCode?

Why are you trying to build libvpx in XCode?

> Moreover I have written the encoded stream in file for for both debug mode
> and release mode library by setting same input parameters and by feeding
> same input test data YUV file.
>
> I have compared the encoded data files obtained form debug and release mode
> run, found that these files are not matching when compared with a file
> compare tool Hex edit.

How are you storing the files? Do you get the same results if you run
the debug or release code multiple times? If you write out the data as
ivf files you can decode them on the desktop with vpxdec. There is
example code in simple_encoder.c which is a generated file. I've
attached it.

> do we have any problems with vp8 codec when optimisation is enabled for IOS
> platform, because same code works fine even with optimisation level set on
> different platforms with their corresponding assembly source for each
> platform.

When you adjust the optimization level are turning off/on the assembly code?
simple_encoder.c

Rahul Ganure

unread,
Dec 15, 2012, 7:43:40 AM12/15/12
to webm-d...@webmproject.org


On Saturday, 15 December 2012 00:12:08 UTC+5:30, Johann wrote:
On Thu, Dec 13, 2012 at 11:11 PM, Rahul Ganure <rahul...@gmail.com> wrote:
> On Friday, 14 December 2012 01:17:44 UTC+5:30, Johann wrote:
>> > Created static library for vp8 works fine in debug mode, but for release
>> > mode its not working.
>>
>> You mentioned in your original message the Debug mode has image
>> quality issues and in Release that the decoder does not work at all.
>> Can you capture the stream and decode with another tool? Can you
>> decode static webm content on the device?
>
> I have worked on finding the reason behind the quality issue in debug mode
> and decoding problems in release mode. I have found out that this sought of
> issue occur only I am setting any sought of optimisation level through xcode
> using apple LLVM complier 4.1

What sort of issue? Is this with libvpx built independently or in XCode?

Quality issue in debug mode static library created by xcode and problem in decoding with release mode static library from Xcode.

Static library from libvpx through command line build has no such issues. I have this issues only when the libvpx source code is taken and project is created to build it on Xcode. 

Why are you trying to build libvpx in XCode?

Because of our application requirements 

> Moreover I have written the encoded stream in file for for both debug mode
> and release mode library by setting same input parameters and by feeding
> same input test data YUV file.
>
> I have compared the encoded data files obtained form debug and release mode
> run, found that these files are not matching  when compared with a file
> compare tool Hex edit.

How are you storing the files? Do you get the same results if you run
the debug or release code multiple times? If you write out the data as
ivf files you can decode them on the desktop with vpxdec. There is
example code in simple_encoder.c which is a generated file. I've
attached it.

I have built two static libraries for vp8 codec one in debug with no optimization levee set and other one in release mode with optimization level set.

If i run my app with debug mode static library two times and compare them both with a tool , two encoded stream are perfectly matching with each other. Same is the case when i run my app with release  mode static library.

If i use ivf files to decode it on standalone desktop with vpxdec, decoding happens fine, but reconstruction of the frame is not proper.

When i use my interface code, to decode the ivf file , all the key frames get decoded. but i get problems while decoding inter frames because my interface code depends on frame count which is parsed from the encoded data, frame count is which is parsed form encoded streams has uncertain behavior, because the encoded data is changing in release mode.

The encoded streams are not matching when I compare two encoded streams written separately into file which are obtained by running my app once with debug mode static lib and once with release mode static lib.

Is the due to optimization level set for release mode to create static lib???

> do we have any problems with vp8 codec when optimisation is enabled for IOS
> platform, because same code works fine even with optimisation level set on
> different platforms with their corresponding assembly source for each
> platform.

When you adjust the optimization level are turning off/on the assembly code?

I am using all the arm related assembly code even when optimization level is set. 

Johann Koenig

unread,
Dec 17, 2012, 12:34:47 PM12/17/12
to webm-d...@webmproject.org
On Sat, Dec 15, 2012 at 4:43 AM, Rahul Ganure <rahul...@gmail.com> wrote:
>> Why are you trying to build libvpx in XCode?
>
> Because of our application requirements

Can you describe how you are adding the code to XCode? I'm working on
creating a project to test this but I'm not very familiar with XCode
so any tips you could offer would be appreciated.

Alias Cummins

unread,
Dec 17, 2012, 8:02:02 PM12/17/12
to webm-d...@webmproject.org
I would also be interested to hear about this.


--
You received this message because you are subscribed to the Google Groups "WebM Discussion" group.
To post to this group, send email to webm-d...@webmproject.org.
To unsubscribe from this group, send email to webm-discuss...@webmproject.org.
For more options, visit this group at http://groups.google.com/a/webmproject.org/group/webm-discuss/?hl=en.




--
Best Regards,
Alias R Cummins
MD, Proalias Limited

http://proalias.com
twitter: @no_other_alias
Companies house number:07675651
VAT registration number:116377220

Rahul Ganure

unread,
Dec 18, 2012, 7:33:07 AM12/18/12
to webm-d...@webmproject.org
I have separated all the asm source files and bundled into one folder and the c and header files into another.

I have created project to create static library for IOS.

I have copied these source folder into project folder, later added these folder into xcode by adding these folders to project.

I have selected Apple LLVM Complier 4.1
Reply all
Reply to author
Forward
0 new messages