Compare commits

..

129 Commits

Author SHA1 Message Date
John Koleszar
744a58bc1c vpx_codec_dec_init: check that the iface is a decoder
Make sure the given interface is actually a decoder interface before
initializing it.

Change-Id: Ie48d737f2956cc2f0891666de5ea87251e96bc49
2011-03-24 15:05:10 +02:00
John Koleszar
86b5556f5a Remove unused vp8_get4x4sse_cs_mmx declaration
This declaration did not match the prototype_sad() prototype, but was
unused in this translation unit, so it is removed instead. Fixes
issue 290.

Change-Id: I168854f88a85f73ca9aaf61d1e5dc0f43fc3fdb3
2011-03-24 15:05:10 +02:00
John Koleszar
4375b4ac39 Allow specifying --end-usage by enum name
Map an enum to the --end-usage values, so you can specify
--end-usage=cq instead of --end-usage=2. The numerical values still
work for historical scripts, etc, but this is more user friendly.

Change-Id: I445ecd9638f801f5924a71eabf449bee293cdd34
2011-03-24 15:05:10 +02:00
Tero Rintaluoma
71595edd47 ARMv6 optimized fdct4x4
Optimized fdct4x4 (8x4) for ARMv6 instruction set.
  - No interlocks in Cortex-A8 pipeline
  - One interlock cycle in ARM11 pipeline
  - About 2.16 times faster than current C-code compiled with -O3

Change-Id: I60484ecd144365da45bb68a960d30196b59952b8
2011-03-24 15:05:10 +02:00
Attila Nagy
848dddee15 Fix multithreaded encoding for 1 MB wide frame
Thread synchronization was not correct when frame width was 1 MB.
Number of allocated encoding threads is limited by the sync_range.
There is no point having more because each thread lags sync_range MBs
behind the thread processing the row above.

http://code.google.com/p/webm/issues/detail?id=302

Change-Id: Icaf67a883beecc5ebf2f11e9be47b6997fdf6f26
2011-03-24 15:05:09 +02:00
John Koleszar
f1ba70e199 Increase static linkage, remove unused functions
A large number of functions were defined with external linkage, even
though they were only used from within one file. This patch changes
their linkage to static and removes the vp8_ prefix from their names,
which should make it more obvious to the reader that the function is
contained within the current translation unit. Functions that were
not referenced were removed.

These symbols were identified by:

  $ nm -A libvpx.a | sort -k3 | uniq -c -f2 | grep ' [A-Z] ' \
    | sort | grep '^ *1 '

Change-Id: I59609f58ab65312012c047036ae1e0634f795779
2011-03-24 15:05:09 +02:00
Attila Nagy
a22df2e29d use semaphore for partition thread synch
Change-Id: If368371097d93614ae497d99be2d39c7b0eb5f47
2011-03-18 13:25:51 +02:00
Ralph Giles
185557344a Set bounds from the array when iterating mmaps.
The mmap allocation code in vp8_dx_iface.c was inconsistent.
The static array vp8_mem_req_segs defines two descriptors,
but only the first is real. The second is a sentinel and
isn't actually allocated, so vpx_codec_alg_priv is declared
with mmaps[NELEMENTS(vp8_mem_req_segs)-1]. Some functions
use this reduced upper bound when iterating though the mmap
array, but these two functions did not.

Instead, this commit calls NELEMENTS(...->mmaps) to directly
query the bounds of the dereferenced array.

This fixes an array-bounds warning from gcc 4.6 on
vp8_xma_set_mmap.

Change-Id: I918e2721b401d134c1a9764c978912bdb3188be1
2011-03-17 14:52:05 -07:00
Ralph Giles
de5182eef3 Remove commented-out VP6 code from vp8_finalize_mmaps
Change-Id: I48642c380353043bed96026f56de5908fcee270a
2011-03-17 14:51:31 -07:00
John Koleszar
8431e768c9 Merge "Fix "used uninitialized" warning in vp8_pack_bitstream()" 2011-03-17 14:25:04 -07:00
John Koleszar
de50520a8c apple: include proper mach primatives
Fixes implicit declaration warning for 'mach_task_self'. This change
is an update to Change I9991dedd1ccfddc092eca86705ecbc3b764b799d,
which fixed this issue for the decoder but not the encoder.

Change-Id: I9df033e81f9520c4f975b7a7cf6c643d12e87c96
2011-03-16 13:59:32 -04:00
Attila Nagy
346b3e7ce9 Remove echoing in obj_int_extract rule
Change-Id: I9965170b40e2f32e9d84895c33a529b0d7dacdc1
2011-03-16 12:56:52 +02:00
Attila Nagy
71bcd9f1af Add vp8_variance8x8_armv6 and vp8_sub_pixel_variance8x8_armv6 functions
Change-Id: I08edaffc62514907fa5e90e1689269e467c857f5
2011-03-15 15:50:44 +02:00
Gaute Strokkenes
6795e256c1 Avoid misspelling "dependent".
Change-Id: Ib0c280e1fcfd977e11e4390807b2c8077a87500c
2011-03-15 12:58:29 +00:00
John Koleszar
8c48c943e7 Merge "Fix an unused variable warning." 2011-03-14 14:13:53 -07:00
Ralph Giles
aa4a90c880 Improve grammar in a comment.
Change-Id: I18bfda6d420626f2718e096e338c1d0bf0ba029d
2011-03-14 13:41:50 -07:00
Johann
2ec0cfbe99 obj_int_extract: win64 does not prefix symbols
obj_int_extract was unconditionally skipping the first character in the
symbol. make sure it's actually an '_' first

Change-Id: Icfe527eb8a0028faeabaa1dcedf8cd8f51c92754
2011-03-14 16:11:02 -04:00
Johann
d0ec28b3d3 Merge "Add vp8_mse16x16_armv6 function" 2011-03-14 12:47:42 -07:00
Attila Nagy
e54dcfe88d Add vp8_mse16x16_armv6 function
Change-Id: I77e9f2f521a71089228f96e2db72524189364ffb
2011-03-14 14:38:31 +02:00
Rafael Ávila de Espíndola
52f6e28e9e Fix build with xcode4 and simplify GLOBAL.
Without this change I get link errors in firefox's libxul. It looks
like the linker expect a particular pattern for getting the GOT. This
patch changes webm to use the same pattern used by the compiler.

Change-Id: Iea8c2e134ad45c1dc7d221ff885a8429bfa4e057
2011-03-12 10:45:22 -05:00
Johann
3788b3564c Merge "Move build_intra_predictors_mby to RTCD framework" 2011-03-11 10:23:48 -08:00
John Koleszar
27972d2c1d Move build_intra_predictors_mby to RTCD framework
The vp8_build_intra_predictors_mby and vp8_build_intra_predictors_mby_s
functions had global function pointers rather than using the RTCD
framework. This can show up as a potential data race with tools such as
helgrind. See https://bugzilla.mozilla.org/show_bug.cgi?id=640935
for an example.

Change-Id: I29c407f828ac2bddfc039f852f138de5de888534
2011-03-11 13:04:50 -05:00
Johann
5c60a646f3 Merge "ARMv6 optimized quantization" 2011-03-11 08:29:00 -08:00
John Koleszar
75051c8b59 Merge "Only enable ssim_opt.asm on X86_64" 2011-03-11 08:28:05 -08:00
John Koleszar
5db0eeea21 Only enable ssim_opt.asm on X86_64
Fix compiling on 32 bit x86.

Change-Id: I6210573e1d9287ac49acbe3d7e5181e309316107
2011-03-11 11:27:08 -05:00
Paul Wilkins
6e73748492 Clean up of vp8_init_config()
Clean up vp8_init_config() a bit and remove null pointer case,
as this code can't be called any more and is not an adequate
trap anyway, as a null pointer would cause exceptions before
hitting the test.

Change-Id: I937c00167cc039b3aa3f645f29c319d58ae8d3ee
2011-03-11 11:06:51 -05:00
John Koleszar
170b87390e Merge "1 Pass CQ and VBR bug fixes" 2011-03-11 08:06:09 -08:00
Paul Wilkins
2ae91fbef0 1 Pass CQ and VBR bug fixes
Issue 291 highlighted  the fact that CQ mode was not working
as expected in 1 pass mode,

This commit fixes that specific problem but in so doing I also
uncovered an overflow issue in the VBR code for 1 pass and
some data values not being correctly initialized.

For some clips (particularly short clips), the resulting
improvement is dramatic.

Change-Id: Ieefd6c6e4776eb8f1b0550dbfdfb72f86b33c960
2011-03-11 10:59:34 -05:00
John Koleszar
e34e417d94 Merge "Fix incorrect macroblock counts in twopass rate control" 2011-03-11 06:06:04 -08:00
Yunqing Wang
3c9dd6c3ef Merge "Align SAD output array to be 16-byte aligned" 2011-03-11 05:56:02 -08:00
John Koleszar
c5c5dcd0be Merge "vp8cx - psnr converted to call assemblerized sse" 2011-03-11 05:54:00 -08:00
John Koleszar
29c46b64a2 Merge "vp8cx- alternate ssim function with optimizations" 2011-03-11 05:53:41 -08:00
Jim Bankoski
3dc382294b vp8cx - psnr converted to call assemblerized sse
Change-Id: Ie388d4618c44b131f96b9fe526618b457f020dfa
2011-03-11 08:51:22 -05:00
Jim Bankoski
3f6f7289aa vp8cx- alternate ssim function with optimizations
Change-Id: I91921b0a90dbaddc7010380b038955be347964b3
2011-03-11 08:51:21 -05:00
Yunqing Wang
b2aa401776 Align SAD output array to be 16-byte aligned
Use aligned store.

Change-Id: Icab4c0c53da811d0c52bb7e8134927f249ba2499
2011-03-11 08:24:23 -05:00
Yunqing Wang
76ec21928c Merge "Encoder loopfilter running in its own thread" 2011-03-11 04:55:05 -08:00
Attila Nagy
9c836daf65 Fix "used uninitialized" warning in vp8_pack_bitstream()
Change-Id: Iadcbdba717439f47a2c24e65fd69a3a1464174b5
2011-03-11 12:36:28 +02:00
Attila Nagy
3ae2465788 Encoder loopfilter running in its own thread
In multithreaded mode the loopfilter is running in its own thread (filter level
calculation and frame filtering). Filtering is mostly done in parallel with the
bitstream packing. Before starting the packing the loopfilter level has
to be calculated. Also any needed reference frame copying is done in the
filter thread.

Currently the encoder will create n+1 threads, where n > 1 is the number of
threads specified by application  and 1 is the extra filter thread. With n = 1
the encoder runs in single thread mode. There will never be more than n threads
running concurrently.

Change-Id: I4fb29b559a40275d6d3babb8727245c40fba931b
2011-03-11 10:52:51 +02:00
Tero Rintaluoma
7ab08e1fee ARMv6 optimized quantization
Adds new ARMv6 optimized function vp8_fast_quantize_b_armv6
to the encoder.

Change-Id: I40277ec8f82e8a6cbc453cf295a0cc9b2504b21e
2011-03-11 10:48:42 +02:00
Johann
128d2c23b3 obj_int_extract for Visual Studio
Enable extraction of assembly offsets from compiled examples in MSVS.
This will allow us to remove some stub functions from x86 assembly since
we will be able to reliably determine structure offsets at compile time.

see ARM code for examples:
vp8/encoder/arm/armv5te/
vpx_scale/arm/neon/

Change-Id: I1852dc6b56ede0bf1dddb5552196222a7c6a902f
2011-03-10 18:49:54 -05:00
Adrian Grange
6daacdb785 Added missing format specifier in print statement
Printout of firstpass stats for frame had one fewer
format specifiers than arguments.

Change-Id: I5a42c85aa79c471e1a70afd75e24a91546b7a1cd
2011-03-10 12:43:49 -08:00
Adrian Grange
ed40ff9e2d Removed firstpass motion map
The firstpass motion map consists of an 8-bit flag for
each MB indicating how strongly the firstpass code
believes it should be filtered during the second pass
ARNR filtering.

For long or large format material the motion map can
become extremely large and hamper the operation of
the encoding process.

This change removes the motion map altogether, leaving
the second pass to rely on the magnitude of the motion
compensated error to determine the filter weight to
use for the MB during ARNR filtering.

Tests on the derf set indicate that the effect of this
change is neutral, with some small wins and losses. The
motion map has therefore been removed based on
a cost/benefit evaluation.

Change-Id: I53e07d236f5ce09a6f0c54e7c4ffbb490fb870f6
2011-03-10 11:32:48 -08:00
James Berry
f3e9e2a0f8 Fix incorrect macroblock counts in twopass rate control
The previous calculation of macroblock count (w*h)/256
is not correct when the width/height are not multiples of
16. Use the precalculated macroblock count from
cpi->common instead. This manifested itself as a divide
by zero when the number of pixels was less than 256.
num_mbs updated in estimate_max_q, estimate_q,
 estimate_kf_group_q, and estimate_cq

Change-Id: I92ff98587864c801b1ee5485cfead964673a9973
2011-03-10 13:33:06 -05:00
Yunqing Wang
a0306ea660 Merge "Add vp8_sub_pixel_variance16x8_ssse3 function" 2011-03-09 12:26:37 -08:00
John Koleszar
c5a049babd Merge branch 'bali'
Change-Id: Icf18b4981afb12ef255fca431d4ba45860dd22c9
2011-03-09 14:11:54 -05:00
John Koleszar
5c24071504 Add missing filter.h to build system
Missing file causes 'make dist' to not include a complete copy of the
source.

Change-Id: I3f55aeb5a86d0e81234e4e4588cb8086ba4cfc4a
2011-03-09 13:43:31 -05:00
Johann
43baf7ff21 Merge "fix obj_int_extract for MinGW" 2011-03-09 09:44:49 -08:00
Yunqing Wang
7b8e7f0f3a Add vp8_sub_pixel_variance16x8_ssse3 function
Added SSSE3 function

Change-Id: I8c304c92458618d93fda3a2f62bd09ccb63e75ad
2011-03-09 12:33:21 -05:00
Yunqing Wang
4561109a69 Remove unused functions
Removed some unused functions

Change-Id: Ifdfc27453e53cfc75997b38492901d193a16b245
2011-03-09 10:45:03 -05:00
Yunqing Wang
7966dd5287 Merge "Improve SSE2 half-pixel filter funtions" 2011-03-09 07:23:06 -08:00
John Koleszar
fa836faede Merge "Configuration updates:Making a clear distinction between Init and Change" 2011-03-09 05:07:11 -08:00
Ralph Giles
56efffdcd1 Fix an unused variable warning.
Move the update of the loopfilter info to the same block where it
is used. GCC 4.5 is not able trace the initialization of the local
filter_info across the other calls between the two conditionals on
pbi->common and issues an uninitialized variable warning.

Change-Id: Ie4487b3714a096b3fb21608f6b0c74e745e3c6fc
2011-03-08 14:56:15 -08:00
Johann
fb037ec05b fix obj_int_extract for MinGW
failed to find headers in the source directory

output to stdout instead of a hardcoded file

MinGW doesn't support _sopen_s

_fstat catches non-existant files

Change-Id: I24e0aacc6f6f26e6bcfc25f9ee7821aa3c8cc7e7
2011-03-08 17:44:52 -05:00
Yunqing Wang
419f638910 Improve SSE2 half-pixel filter funtions
Rewrote these functions to process 16 pixels once instead of 8.

Change-Id: Ic67e80124467a446a3df4cfecfb76a4248602adb
2011-03-08 16:25:06 -05:00
Johann
95adf3df77 Merge "64bit mach-o support" 2011-03-08 12:29:32 -08:00
Yunqing Wang
859abd6b5d Merge "Add zero offset checking in SSE2 sub-pixel filter function" 2011-03-08 12:26:58 -08:00
Yunqing Wang
8432a1729f Add zero offset checking in SSE2 sub-pixel filter function
Skip filter at zero offset.

Change-Id: I95fc7e211869bc0ab5bcfb7ab2e3259d1c0ccf38
2011-03-08 15:22:07 -05:00
Yunqing Wang
e8f7b0f7f5 Merge "Write SSSE3 sub-pixel filter function" 2011-03-08 10:58:30 -08:00
Yunqing Wang
244e2e1451 Write SSSE3 sub-pixel filter function
1. Process 16 pixels at one time instead of 8.
2. Add check for both xoffset =0 and yoffset=0, which happens
   during motion search.
This change gave encoder 1%~3% performance gain.

Change-Id: Idaa39506b48f4f8b2fbbeb45aae8226fa32afb3e
2011-03-08 13:29:01 -05:00
Johann
5091e01ea1 64bit mach-o support
enable parsing 64bit mach-o files (OS X)

also fixes --enable-debug issue!

Change-Id: I250ee69745cd2365e3e63264f9365cd58fbb6678
2011-03-08 11:42:30 -05:00
Johann
ddd260eb62 64bit elf support
enable parsing 64bit elf files

Change-Id: I7981f4769cf1b822f288fe2e32166254e4394bab
2011-03-08 10:49:35 -05:00
Ralph Giles
e6948bf0f9 Fix a multi-line format-string warning.
GCC 4.5 and 4.6 both issue a warning about the multi-line format
string introduced in bc9c30a0, which also changed the whitespace
in the associated stt file by line-wrapping the long format string.

Instead, use multiple string constants, which the compiler will
concatenate. This maintains the original formatting, but remains
legible within the standard line length.

Change-Id: I27c9f92d46be82d408105a3a4091f145f677e00e
2011-03-08 07:14:12 -08:00
Paul Wilkins
de87c420ef Corrected minor typos.
Change-Id: Icc9f12bd1e1bdaf51256dc8a90d08aa9be89ef34
2011-03-08 14:46:22 +00:00
Paul Wilkins
0eccee4378 Merge changes I00c3e823,If8bca004
* changes:
  Improved key frame detection.
  Improved KF insertion after fades to still.
2011-03-08 06:40:11 -08:00
John Koleszar
5d1d9911cb correct zbin boost for splitmv mode
Disable zbin boost in SPLITMV mode as intended. Was incorrectly looking
at vp8_ref_frame_order instead of vp8_mode_order when comparing against
SPLITMV. This condition should have always been false, as SPLITMV is
not in the range of valid reference frames.

Change-Id: I0408cc7595eff68f00efef6d008e79f5b60d14bf
2011-03-07 20:58:37 -05:00
John Koleszar
1016b856d1 Merge "Fix format-string warning" 2011-03-07 13:25:28 -08:00
Ralph Giles
fe9a604b1e Fix format-string warning
Cast size_t to (unsigned long) and print it with the %lu format
string, which is more portable than C99's explict %zu for size_t.

This truncates on Windows x64 but otherwise works on 32 and 64 bit
platforms. In practice the stats file is unlikely to be so large.

Change-Id: I0432b3acf85fc6ba4ad50640942e1ca4614b21cb
2011-03-07 13:21:39 -08:00
Paul Wilkins
bc9c30a003 Improved key frame detection.
In some cases where clips have been encoded with
borders (eg. some wide-screen content where there is a
border top and bottom and slide shows containing portrait
format photographs (border left and right)) key frames were
not being correctly detected.

The new code looks to measure cases where a portion of
the image can be coded equally easily using intra or inter
modes and where the resulting error score is also very low.
These "neutral" areas are then discounted in the key frame
detection code.

Change-Id: I00c3e8230772b8213cdc08020e1990cf83b780d8
2011-03-07 15:58:07 +00:00
Paul Wilkins
9fc8cb39aa Improved KF insertion after fades to still.
This code extends what was previously done for GFs, to pick
cases where insertion of a key frame after a fade (or other
transition or complex motion)  followed by a still section, will
be beneficial and will reduce the number of forced key frames.

Change-Id: If8bca00457f0d5f83dc3318a587f61c17d90f135
2011-03-07 15:11:09 +00:00
John Koleszar
0491c2cfc8 Update CHANGELOG for v0.9.6 (Bali) release
Change-Id: I7d1e7db1866d829f6d4c6638d1c20e99959cc9a3
2011-03-04 14:32:24 -05:00
John Koleszar
3fae3283e6 Update AUTHORS
Change-Id: I784ea2b9fabbec1e99d02e97209981ff1b18ac82
2011-03-04 11:12:06 -05:00
John Koleszar
d05c4d8841 Update .mailmap
Add mappings for Tom Finegan, Tero Rintaluoma

Change-Id: I014ad5bb7c8eb8261808d98ec0d4f77a8e7c3f35
2011-03-04 11:11:15 -05:00
Johann
e38c1680d6 Merge "examples: use function to get iface pointers" 2011-03-04 06:01:46 -08:00
Johann
77ed11c506 Merge "change CFLAGS for 64 bit icc builds" 2011-03-04 05:59:31 -08:00
John Koleszar
4a742e5c79 cosmetic: clean up comments for new vp8dx controls
Rename the common control id enum vp8_{dec,com}_control_id,
move VP8_DECODER_CTRL_ID_START to common, wrap long lines.

Change-Id: I659abc62f10aa389d496f7f43950775db0ef2f9f
2011-03-04 08:51:39 -05:00
John Koleszar
27c04aaa67 Merge "clean up msvs project generation" 2011-03-04 05:44:54 -08:00
John Koleszar
0bc31f1887 Merge "Fixing divide by zero" 2011-03-04 05:40:33 -08:00
John Koleszar
fb37eda3e2 Merge "Fix drastic undershoot in long form content" 2011-03-04 05:39:40 -08:00
John Koleszar
05d75b4353 Merge "documentation: minor updates to vp8 (en|de)coder" 2011-03-04 05:38:26 -08:00
John Koleszar
eed2ce58e3 Merge "Fix counter of fixed keyframe distance" 2011-03-04 05:28:38 -08:00
Mikhal Shemer
84f7f20985 Configuration updates:Making a clear distinction between Init and Change
Change-Id: I7b2fb326e1aabc08b032177a7b914a5b8bb7376f
2011-03-03 10:35:09 -08:00
Mikhal Shemer
1de99a2a81 Fixing divide by zero
Change-Id: I9d8a98a2f7ed1e3116d0bae35164618c41998bac
2011-03-03 10:33:36 -08:00
John Koleszar
36be4f7f06 Fix drastic undershoot in long form content
When the modified_error_left accumulator exceeds INT_MAX, an incorrect
cast to int resulted in a negative value, causing the rate control to
allocate no bits to that keyframe group, leading to severe undershoot
and subsequent poor quality.

This error was exposed by the recent change to the rolling target and
actual spend accumulators in commit 305be4e4 which fixed them to
actually calculate the average value rather than be re-initialized
on every frame to the average per-frame bitrate. When this bug was
triggered, the target bitrate could be 0, so the rolling target
becomes small, which causes the undershoot. The code prior to 305be4e4
did not exhibit this behavior because the rolling target was always
set to a reasonable value and was independent of the actual target
bitrate. With this patch, the actual target bitrate is calculated
correctly, and the rate control tracks as expected.

This cast was likely added to silence a compiler warning on a comparison
between a double (modified_error_left) and an int (0). Instead, this
patch removes the cast and changes the comparison to be against 0.0,
which should prevent the warning from reoccuring.

This fixes issue #289. Special thanks to gnafu for his efforts in
reporting and debugging this fix.

Change-Id: Ie5cc1a7b516c578a76c3a50c892a6f04a11621fe
2011-03-02 22:52:27 -05:00
Johann
a1cfcb413d clean up msvs project generation
add visual studio 9 to --help

remove cpp, cxx, hpp, hxx files from filter

add the ability to target project names. this will be necessary to
enable obj_int_extract

Change-Id: I407583320d8b67a0df40c07221838c42678792f7
2011-03-02 09:34:34 -05:00
Johann
6f5189c044 Merge "ARMv6 optimized half pixel variance calculations" 2011-03-02 05:48:46 -08:00
John Koleszar
06ce0d8830 change CFLAGS for 64 bit icc builds
AMD64 only implies SSE2, not SSE3. There aren't any known cases where
icc was generating SSE3 instructions since all the vectorizable code
is already in handwritten asm, so this fix is included mostly for
correctness. Fixes issue #259.

Change-Id: I993335a4740b68b559035305fb52ca725a6beaff
2011-02-28 20:16:14 -05:00
John Koleszar
987ac89403 examples: use function to get iface pointers
MSVC can't pass the address of global variables in a DLL correctly
across DLL boundaries. This patch allows linking the examples to
a libvpx dll build. Fixes issue #268.

Change-Id: I1c52d076cfc68efb3efdfba019f12d53c5019f58
2011-02-28 20:06:59 -05:00
Yunqing Wang
cfaee9f7c6 Merge "Add prefetch before variance calculation" 2011-02-28 11:42:28 -08:00
Scott LaVarnway
3e6d476ac3 Merge "Avoid double copying of key frames into alt and golden buffer" 2011-02-28 10:16:33 -08:00
Yunqing Wang
d96ba65a23 Add prefetch before variance calculation
This improved encoding performance by 0.5% (good, speed 1) to
1.5% (good, speed 5).

Change-Id: I843d72a0d68a90b5f694adf770943e4a4618f50e
2011-02-28 11:25:55 -05:00
John Koleszar
4decd27947 Merge "Remove examples.doxy dep w/--disable-examples" 2011-02-28 07:18:41 -08:00
Johann
31dab574cc Merge "Remove a second check for invalid ptr in vp8_get_compressed_data" 2011-02-25 11:44:18 -08:00
Aaron Watry
da761c9a22 Fix crash on Sparc Solaris.
Sparc on Solaris requires memory copies in reconinter.c to be aligned.

Change-Id: I6c5b75fb80d6fd501ae4b41b533c3109c2f32be2
2011-02-25 10:14:10 -05:00
Johann
e4fa638653 Merge "Remove temporal alt ref from realtime only build" 2011-02-25 06:55:17 -08:00
Johann
1fae7018a8 Merge "Handle mem allocation failure in vp8e_init" 2011-02-25 06:55:10 -08:00
Attila Nagy
d8fc974ac0 Avoid double copying of key frames into alt and golden buffer
Change-Id: I726976a297a593a35ed6cba3c660e372562f7b27
2011-02-25 09:03:16 +02:00
Attila Nagy
6da2018789 Remove a second check for invalid ptr in vp8_get_compressed_data
Check is done first when function si entered.

Change-Id: Ief0d0cbd4860aaf492b78728f8d22f24029b1174
2011-02-25 08:41:13 +02:00
James Zern
1771722b2f Remove examples.doxy dep w/--disable-examples
This allows the base documentation to be built without the need for php
which is required to produce the example documentation

Change-Id: Id1861723c672fa8da132a074a4657e2cb94c1e79
2011-02-24 15:11:05 -08:00
James Zern
8e17e82d9e documentation: minor updates to vp8 (en|de)coder
Group algorithm interfaces to avoid undocumented warning from doxygen
and provide basic documentation for CQ level & cpuused.

Change-Id: I11095061be962cbc998741de9c8c3019d415e137
2011-02-24 14:12:57 -08:00
Scott LaVarnway
861175ef00 Removed vp8_block2type
and used defines instead.

Change-Id: Idb56e0295d004793f406dfd2d8d8c546aad62e03
2011-02-24 14:35:18 -05:00
Scott LaVarnway
d53492bba4 Merge "Revisited rd_pick_intra4x4block" 2011-02-24 11:25:21 -08:00
Scott LaVarnway
658454a04c Revisited rd_pick_intra4x4block
Removed unnecessary copies.  No noticeable speed gains.


Change-Id: I996c50c23fedd06d54ee7a3e762cbf559cc4a9d1
2011-02-24 13:31:47 -05:00
Paul Wilkins
b862c108dd Overflow of frame error accumulators.
This fixes an overflow problem in the frame error accumulators.

The overflow condition is extreme but did trigger when Frank B.
coded some high motion interlaced HD content.

The observed effect was a catastrophic  breakdown of the rate
control leading to massive undershoot and poor bit allocation.

All the error values should really be unsigned but I will look at this
separately.

Change-Id: I9745f5c5ca2783620426b66b568b2088b579151f
2011-02-24 15:49:41 +00:00
Johann
aee120afb9 Merge "documentation: minor cosmetics" 2011-02-24 07:01:25 -08:00
Tero Rintaluoma
8ae92aef66 ARMv6 optimized half pixel variance calculations
Adds following ARMv6 optimized functions to the encoder:
 - vp8_variance_halfpixvar16x16_h_armv6
 - vp8_variance_halfpixvar16x16_v_armv6
 - vp8_variance_halfpixvar16x16_hv_armv6

Change-Id: I1e9c2af7acd2a51b72b3845beecd990db4bebd29
2011-02-23 13:27:27 +02:00
Attila Nagy
e6db21ecc4 Handle mem allocation failure in vp8e_init
Change-Id: I0d0445c57eb0889082f83de1948852d57b38fefb
2011-02-23 12:36:03 +02:00
Johann
418f4219fa purge wince configuration
this has been broken since the initial release

Change-Id: If0d4deb2de9f7d0c4c05641e2bbf9cc1bf11e171
2011-02-22 14:42:00 -05:00
Attila Nagy
7af0d906e3 Remove temporal alt ref from realtime only build
It is not used in realtime mode. Reduces memory footprint.

Change-Id: I7f163225762368df5457cfd413050161d3704a3f
2011-02-22 12:53:32 +02:00
Johann
945dad277d Revert "use unaligned load"
This reverts commit f50f2fd2a7.

Change Ib7506e3e aligns the buffer

Change-Id: Ie0f8bd3e57cfdfef81d39638a1451458ebbae2e0
2011-02-18 10:23:02 -05:00
John Koleszar
c764c2a20f Merge "clean up unused files" 2011-02-18 06:33:05 -08:00
John Koleszar
3ed8fe8778 remove unused vp8_predict_dc function
Change-Id: I64fa47889c54cfed094a674c49ef0996d49bdd42
2011-02-18 09:12:20 -05:00
John Koleszar
cbf923b12c clean up unused files
Removed a number of files that were unused or little-used.

Change-Id: If9ae5e5b11390077581a9a879e8a0defe709f5da
2011-02-18 09:09:49 -05:00
John Koleszar
d371ca93e5 cosmetic: remove unnecessary scope
Clean up some unnecessary scoping around pick_filter_level.

Change-Id: Ic57fa33e3fcae37fe6beae977e5743783399d5af
2011-02-18 08:46:07 -05:00
John Koleszar
597d02b508 Merge "Dont pick encoder filter level when loopfilter is disabled." 2011-02-18 05:26:23 -08:00
Attila Nagy
fb5a692d27 Reinitialize quantizer only when any delta is changing
No need to reinitialize for base Q changes.

Change-Id: Ie76ec21dd3c5582d5183dbed75ed73a1eed3e291
2011-02-18 14:23:37 +02:00
Attila Nagy
c6ef75690f Dont pick encoder filter level when loopfilter is disabled.
Change-Id: I58154faf4f3ece24f9927a5c3ab7e830e0887fb6
2011-02-18 08:53:00 +02:00
John Koleszar
b2ae57f1b6 Merge "Use endian-neutral bitstream packing/unpacking" 2011-02-17 12:34:16 -08:00
John Koleszar
562f1470ce Use endian-neutral bitstream packing/unpacking
Eliminate unnecessary checks on target endianness and associated
macros.

Change-Id: I1d4e6a9dcee9bfc8940c8196838d31ed31b0e4aa
2011-02-17 15:20:53 -05:00
John Koleszar
ac10665ad8 Merge "Removed unused vp8_recon_intra4x4mb function" 2011-02-17 11:30:13 -08:00
Scott LaVarnway
07f7b66fae Removed unused vp8_recon_intra4x4mb function
Change-Id: I4a328ce152d9dbe6b0d1606d1b523e8e7bfb468e
2011-02-17 13:34:38 -05:00
John Koleszar
c351aa7f1b Merge "Fix relative include paths" 2011-02-17 04:13:44 -08:00
James Zern
f42d52e6bd documentation: minor cosmetics
- correct spelling
- remove explicit file name w/\file (unnecessary when contained in the
  same file and prone to desync)

Change-Id: I68a3960ac5ab84d0f2e5c9b2e29799f26dfccf23
2011-02-16 17:59:33 -08:00
Yunqing Wang
da9402fbf6 Merge "Allocate source buffers to be multiples of 16" 2011-02-16 11:35:06 -08:00
Yunqing Wang
da227b901d Allocate source buffers to be multiples of 16
Currently, when the video frame width is not multiples of 16, the
source buffer has a stride of non-multiples of 16, which forces
an unaligned load in SAD function and hurts the performance. To
avoid that, this change allocates source buffers to be multiples
of 16.

Change-Id: Ib7506e3eb2cea06657d56be5a899f38dfe3eeb39
2011-02-16 12:57:17 -05:00
Johann
0c2cfff9b0 Merge "ARMv6 optimized sad16x16" 2011-02-16 05:22:38 -08:00
James Zern
0030303b69 Remove redundant ptr checks in calls to vpx_free
vpx_free if used contains this check. If replaced, well behaved free
will behave similarly.

Change-Id: I25483aaa8b39255b9a8cf388d6e5eaa20a908ae1
2011-02-15 12:43:35 -08:00
Tero Rintaluoma
1ef86980b9 ARMv6 optimized sad16x16
Adds a new ARMv6 optimized function vp8_sad16x16_armv6 to encoder.

Change-Id: Ibbd7edb8b25cb7a5b522d391b1e9a690fe150e57
2011-02-11 11:14:07 +02:00
John Koleszar
02321de0f2 Fix relative include paths
Allow compiling without adding vp8/{common,encoder,decoder} to the
include paths.

Change-Id: Ifeb5dac351cdfadcd659736f5158b315a0030b6c
2011-02-10 15:09:44 -05:00
Andoni Morales Alastruey
48140167cd Fix counter of fixed keyframe distance
When the keyframe distance is fixed the first interval has the right
distance but, the next ones have kf_distance + 1.

Change-Id: I44f1190fe7146124bd07660a5e0ef08829e3ae07
2011-02-07 18:30:04 +01:00
198 changed files with 4823 additions and 17888 deletions

View File

@@ -1,2 +1,4 @@
Adrian Grange <agrange@google.com>
Johann Koenig <johannkoenig@google.com>
Tero Rintaluoma <teror@google.com> <tero.rintaluoma@on2.com>
Tom Finegan <tomfinegan@google.com>

View File

@@ -4,13 +4,18 @@
Aaron Watry <awatry@gmail.com>
Adrian Grange <agrange@google.com>
Alex Converse <alex.converse@gmail.com>
Andoni Morales Alastruey <ylatuya@gmail.com>
Andres Mejia <mcitadel@gmail.com>
Attila Nagy <attilanagy@google.com>
Fabio Pedretti <fabio.ped@libero.it>
Frank Galligan <fgalligan@google.com>
Fredrik Söderquist <fs@opera.com>
Fritz Koenig <frkoenig@google.com>
Gaute Strokkenes <gaute.strokkenes@broadcom.com>
Giuseppe Scrivano <gscrivano@gnu.org>
Guillermo Ballester Valor <gbvalor@gmail.com>
Henrik Lundin <hlundin@google.com>
James Berry <jamesberry@google.com>
James Zern <jzern@google.com>
Jan Kratochvil <jan.kratochvil@redhat.com>
Jeff Muizelaar <jmuizelaar@mozilla.com>
@@ -23,10 +28,14 @@ Luca Barbato <lu_zero@gentoo.org>
Makoto Kato <makoto.kt@gmail.com>
Martin Ettl <ettl.martin78@googlemail.com>
Michael Kohler <michaelkohler@live.com>
Mikhal Shemer <mikhal@google.com>
Pascal Massimino <pascal.massimino@gmail.com>
Patrik Westin <patrik.westin@gmail.com>
Paul Wilkins <paulwilkins@google.com>
Pavol Rusnak <stick@gk2.sk>
Philip Jägenstedt <philipj@opera.com>
Scott LaVarnway <slavarnway@google.com>
Tero Rintaluoma <teror@google.com>
Timothy B. Terriberry <tterribe@xiph.org>
Tom Finegan <tomfinegan@google.com>
Yaowu Xu <yaowu@google.com>

View File

@@ -1,3 +1,80 @@
2011-03-07 v0.9.6 "Bali"
Our second named release, focused on a faster, higher quality, encoder.
- Upgrading:
This release is backwards compatible with Aylesbury (v0.9.5). Users
of older releases should refer to the Upgrading notes in this
document for that release.
- Enhancements:
vpxenc --psnr shows a summary when encode completes
--tune=ssim option to enable activity masking
improved postproc visualizations for development
updated support for Apple iOS to SDK 4.2
query decoder to determine which reference frames were updated
implemented error tracking in the decoder
fix pipe support on windows
- Speed:
Primary focus was on good quality mode, speed 0. Average improvement
on x86 about 40%, up to 100% on user-generated content at that speed.
Best quality mode speed improved 35%, and realtime speed 10-20%. This
release also saw significant improvement in realtime encoding speed
on ARM platforms.
Improved encoder threading
Dont pick encoder filter level when loopfilter is disabled.
Avoid double copying of key frames into alt and golden buffer
FDCT optimizations.
x86 sse2 temporal filter
SSSE3 version of fast quantizer
vp8_rd_pick_best_mbsegmentation code restructure
Adjusted breakout RD for SPLITMV
Changed segmentation check order
Improved rd_pick_intra4x4block
Adds armv6 optimized variance calculation
ARMv6 optimized sad16x16
ARMv6 optimized half pixel variance calculations
Full search SAD function optimization in SSE4.1
Improve MV prediction accuracy to achieve performance gain
Improve MV prediction in vp8_pick_inter_mode() for speed>3
- Quality:
Best quality mode improved PSNR 6.3%, and SSIM 6.1%. This release
also includes support for "activity masking," which greatly improves
SSIM at the expense of PSNR. For now, this feature is available with
the --tune=ssim option. Further experimentation in this area
is ongoing. This release also introduces a new rate control mode
called "CQ," which changes the allocation of bits within a clip to
the sections where they will have the most visual impact.
Tuning for the more exact quantizer.
Relax rate control for last few frames
CQ Mode
Limit key frame quantizer for forced key frames.
KF/GF Pulsing
Add simple version of activity masking.
make rdmult adaptive for intra in quantizer RDO
cap the best quantizer for 2nd order DC
change the threshold of DC check for encode breakout
- Bug Fixes:
Fix crash on Sparc Solaris.
Fix counter of fixed keyframe distance
ARNR filter pointer update bug fix
Fixed use of motion percentage in KF/GF group calc
Changed condition for using RD in Intra Mode
Fix encoder real-time only configuration.
Fix ARM encoder crash with multiple token partitions
Fixed bug first cluster timecode of webm file is wrong.
Fixed various encoder bugs with odd-sized images
vp8e_get_preview fixed when spatial resampling enabled
quantizer: fix assertion in fast quantizer path
Allocate source buffers to be multiples of 16
Fix for manual Golden frame frequency
Fix drastic undershoot in long form content
2010-10-28 v0.9.5 "Aylesbury"
Our first named release, focused on a faster decoder, and a better encoder.

4
README
View File

@@ -45,18 +45,14 @@ COMPILING THE APPLICATIONS/LIBRARIES:
armv5te-linux-rvct
armv5te-linux-gcc
armv5te-symbian-gcc
armv5te-wince-vs8
armv6-darwin-gcc
armv6-linux-rvct
armv6-linux-gcc
armv6-symbian-gcc
armv6-wince-vs8
iwmmxt-linux-rvct
iwmmxt-linux-gcc
iwmmxt-wince-vs8
iwmmxt2-linux-rvct
iwmmxt2-linux-gcc
iwmmxt2-wince-vs8
armv7-linux-rvct
armv7-linux-gcc
mips32-linux-gcc

View File

@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<VisualStudioToolFile
Name="armasm"
Version="8.00"
>
<Rules>
<CustomBuildRule
Name="ARMASM"
DisplayName="Armasm Assembler"
CommandLine="armasm -o &quot;$(IntDir)\$(InputName).obj&quot; $(InputPath) -32 -ARCH 5&#x0D;&#x0A;"
Outputs="$(IntDir)\$(InputName).obj"
FileExtensions="*.asm"
ExecutionDescription="Assembling $(InputName).asm"
ShowOnlyRuleProperties="false"
>
<Properties>
</Properties>
</CustomBuildRule>
</Rules>
</VisualStudioToolFile>

View File

@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<VisualStudioToolFile
Name="armasm"
Version="8.00"
>
<Rules>
<CustomBuildRule
Name="ARMASM"
DisplayName="Armasm Assembler"
CommandLine="armasm -o &quot;$(IntDir)\$(InputName).obj&quot; $(InputPath) -32 -ARCH 6&#x0D;&#x0A;"
Outputs="$(IntDir)\$(InputName).obj"
FileExtensions="*.asm"
ExecutionDescription="Assembling $(InputName).asm"
ShowOnlyRuleProperties="false"
>
<Properties>
</Properties>
</CustomBuildRule>
</Rules>
</VisualStudioToolFile>

View File

@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<VisualStudioToolFile
Name="armasm"
Version="8.00"
>
<Rules>
<CustomBuildRule
Name="ARMASM"
DisplayName="Armasm Assembler"
CommandLine="armasm -o &quot;$(IntDir)\$(InputName).obj&quot; $(InputPath) -32 -cpu XSCALE&#x0D;&#x0A;"
Outputs="$(IntDir)\$(InputName).obj"
FileExtensions="*.asm"
ExecutionDescription="Assembling $(InputName).asm"
ShowOnlyRuleProperties="false"
>
<Properties>
</Properties>
</CustomBuildRule>
</Rules>
</VisualStudioToolFile>

View File

@@ -1,13 +0,0 @@
@echo off
REM Copyright (c) 2010 The WebM project authors. All Rights Reserved.
REM
REM Use of this source code is governed by a BSD-style license
REM that can be found in the LICENSE file in the root of the source
REM tree. An additional intellectual property rights grant can be found
REM in the file PATENTS. All contributing project authors may
REM be found in the AUTHORS file in the root of the source tree.
echo on
cl /I ".\\" /I "..\vp6_decoder_sdk" /I "..\vp6_decoder_sdk\vpx_ports" /D "NDEBUG" /D "_WIN32_WCE=0x420" /D "UNDER_CE" /D "WIN32_PLATFORM_PSPC" /D "WINCE" /D "_LIB" /D "ARM" /D "_ARM_" /D "_UNICODE" /D "UNICODE" /FD /EHsc /MT /GS- /fp:fast /GR- /Fo"Pocket_PC_2003__ARMV4_\%1/" /Fd"Pocket_PC_2003__ARMV4_\%1/vc80.pdb" /W3 /nologo /c /TC ..\vp6_decoder_sdk\vp6_decoder\algo\common\arm\dec_asm_offsets_arm.c
obj_int_extract.exe rvds "Pocket_PC_2003__ARMV4_\%1/dec_asm_offsets_arm.obj"

View File

@@ -1,88 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example", "example.vcproj", "{BA5FE66F-38DD-E034-F542-B1578C5FB950}"
ProjectSection(ProjectDependencies) = postProject
{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74} = {DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}
{E1360C65-D375-4335-8057-7ED99CC3F9B2} = {E1360C65-D375-4335-8057-7ED99CC3F9B2}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_int_extract", "obj_int_extract.vcproj", "{E1360C65-D375-4335-8057-7ED99CC3F9B2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vpx", "vpx.vcproj", "{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}"
ProjectSection(ProjectDependencies) = postProject
{E1360C65-D375-4335-8057-7ED99CC3F9B2} = {E1360C65-D375-4335-8057-7ED99CC3F9B2}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xma", "xma.vcproj", "{A955FC4A-73F1-44F7-135E-30D84D32F022}"
ProjectSection(ProjectDependencies) = postProject
{E1360C65-D375-4335-8057-7ED99CC3F9B2} = {E1360C65-D375-4335-8057-7ED99CC3F9B2}
{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74} = {DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|Pocket PC 2003 (ARMV4) = Debug|Pocket PC 2003 (ARMV4)
Debug|Win32 = Debug|Win32
Release|Mixed Platforms = Release|Mixed Platforms
Release|Pocket PC 2003 (ARMV4) = Release|Pocket PC 2003 (ARMV4)
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BA5FE66F-38DD-E034-F542-B1578C5FB950}.Debug|Mixed Platforms.ActiveCfg = Debug|Pocket PC 2003 (ARMV4)
{BA5FE66F-38DD-E034-F542-B1578C5FB950}.Debug|Mixed Platforms.Build.0 = Debug|Pocket PC 2003 (ARMV4)
{BA5FE66F-38DD-E034-F542-B1578C5FB950}.Debug|Mixed Platforms.Deploy.0 = Debug|Pocket PC 2003 (ARMV4)
{BA5FE66F-38DD-E034-F542-B1578C5FB950}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Pocket PC 2003 (ARMV4)
{BA5FE66F-38DD-E034-F542-B1578C5FB950}.Debug|Pocket PC 2003 (ARMV4).Build.0 = Debug|Pocket PC 2003 (ARMV4)
{BA5FE66F-38DD-E034-F542-B1578C5FB950}.Debug|Pocket PC 2003 (ARMV4).Deploy.0 = Debug|Pocket PC 2003 (ARMV4)
{BA5FE66F-38DD-E034-F542-B1578C5FB950}.Debug|Win32.ActiveCfg = Debug|Pocket PC 2003 (ARMV4)
{BA5FE66F-38DD-E034-F542-B1578C5FB950}.Release|Mixed Platforms.ActiveCfg = Release|Pocket PC 2003 (ARMV4)
{BA5FE66F-38DD-E034-F542-B1578C5FB950}.Release|Mixed Platforms.Build.0 = Release|Pocket PC 2003 (ARMV4)
{BA5FE66F-38DD-E034-F542-B1578C5FB950}.Release|Mixed Platforms.Deploy.0 = Release|Pocket PC 2003 (ARMV4)
{BA5FE66F-38DD-E034-F542-B1578C5FB950}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Pocket PC 2003 (ARMV4)
{BA5FE66F-38DD-E034-F542-B1578C5FB950}.Release|Pocket PC 2003 (ARMV4).Build.0 = Release|Pocket PC 2003 (ARMV4)
{BA5FE66F-38DD-E034-F542-B1578C5FB950}.Release|Pocket PC 2003 (ARMV4).Deploy.0 = Release|Pocket PC 2003 (ARMV4)
{BA5FE66F-38DD-E034-F542-B1578C5FB950}.Release|Win32.ActiveCfg = Release|Pocket PC 2003 (ARMV4)
{E1360C65-D375-4335-8057-7ED99CC3F9B2}.Debug|Mixed Platforms.ActiveCfg = Release|Win32
{E1360C65-D375-4335-8057-7ED99CC3F9B2}.Debug|Mixed Platforms.Build.0 = Release|Win32
{E1360C65-D375-4335-8057-7ED99CC3F9B2}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Win32
{E1360C65-D375-4335-8057-7ED99CC3F9B2}.Debug|Win32.ActiveCfg = Release|Win32
{E1360C65-D375-4335-8057-7ED99CC3F9B2}.Debug|Win32.Build.0 = Release|Win32
{E1360C65-D375-4335-8057-7ED99CC3F9B2}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{E1360C65-D375-4335-8057-7ED99CC3F9B2}.Release|Mixed Platforms.Build.0 = Release|Win32
{E1360C65-D375-4335-8057-7ED99CC3F9B2}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Win32
{E1360C65-D375-4335-8057-7ED99CC3F9B2}.Release|Win32.ActiveCfg = Release|Win32
{E1360C65-D375-4335-8057-7ED99CC3F9B2}.Release|Win32.Build.0 = Release|Win32
{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Debug|Mixed Platforms.ActiveCfg = Debug|Pocket PC 2003 (ARMV4)
{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Debug|Mixed Platforms.Build.0 = Debug|Pocket PC 2003 (ARMV4)
{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Debug|Mixed Platforms.Deploy.0 = Debug|Pocket PC 2003 (ARMV4)
{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Pocket PC 2003 (ARMV4)
{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Debug|Pocket PC 2003 (ARMV4).Build.0 = Debug|Pocket PC 2003 (ARMV4)
{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Debug|Pocket PC 2003 (ARMV4).Deploy.0 = Debug|Pocket PC 2003 (ARMV4)
{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Debug|Win32.ActiveCfg = Debug|Pocket PC 2003 (ARMV4)
{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Release|Mixed Platforms.ActiveCfg = Release|Pocket PC 2003 (ARMV4)
{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Release|Mixed Platforms.Build.0 = Release|Pocket PC 2003 (ARMV4)
{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Release|Mixed Platforms.Deploy.0 = Release|Pocket PC 2003 (ARMV4)
{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Pocket PC 2003 (ARMV4)
{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Release|Pocket PC 2003 (ARMV4).Build.0 = Release|Pocket PC 2003 (ARMV4)
{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Release|Pocket PC 2003 (ARMV4).Deploy.0 = Release|Pocket PC 2003 (ARMV4)
{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Release|Win32.ActiveCfg = Release|Pocket PC 2003 (ARMV4)
{A955FC4A-73F1-44F7-135E-30D84D32F022}.Debug|Mixed Platforms.ActiveCfg = Debug|Pocket PC 2003 (ARMV4)
{A955FC4A-73F1-44F7-135E-30D84D32F022}.Debug|Mixed Platforms.Build.0 = Debug|Pocket PC 2003 (ARMV4)
{A955FC4A-73F1-44F7-135E-30D84D32F022}.Debug|Mixed Platforms.Deploy.0 = Debug|Pocket PC 2003 (ARMV4)
{A955FC4A-73F1-44F7-135E-30D84D32F022}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Pocket PC 2003 (ARMV4)
{A955FC4A-73F1-44F7-135E-30D84D32F022}.Debug|Pocket PC 2003 (ARMV4).Build.0 = Debug|Pocket PC 2003 (ARMV4)
{A955FC4A-73F1-44F7-135E-30D84D32F022}.Debug|Pocket PC 2003 (ARMV4).Deploy.0 = Debug|Pocket PC 2003 (ARMV4)
{A955FC4A-73F1-44F7-135E-30D84D32F022}.Debug|Win32.ActiveCfg = Debug|Pocket PC 2003 (ARMV4)
{A955FC4A-73F1-44F7-135E-30D84D32F022}.Release|Mixed Platforms.ActiveCfg = Release|Pocket PC 2003 (ARMV4)
{A955FC4A-73F1-44F7-135E-30D84D32F022}.Release|Mixed Platforms.Build.0 = Release|Pocket PC 2003 (ARMV4)
{A955FC4A-73F1-44F7-135E-30D84D32F022}.Release|Mixed Platforms.Deploy.0 = Release|Pocket PC 2003 (ARMV4)
{A955FC4A-73F1-44F7-135E-30D84D32F022}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Pocket PC 2003 (ARMV4)
{A955FC4A-73F1-44F7-135E-30D84D32F022}.Release|Pocket PC 2003 (ARMV4).Build.0 = Release|Pocket PC 2003 (ARMV4)
{A955FC4A-73F1-44F7-135E-30D84D32F022}.Release|Pocket PC 2003 (ARMV4).Deploy.0 = Release|Pocket PC 2003 (ARMV4)
{A955FC4A-73F1-44F7-135E-30D84D32F022}.Release|Win32.ActiveCfg = Release|Pocket PC 2003 (ARMV4)
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -152,8 +152,8 @@ endif
# Rule to extract assembly constants from C sources
#
obj_int_extract: build/make/obj_int_extract.c
$(if $(quiet),echo " [HOSTCC] $@")
$(qexec)$(HOSTCC) -I. -o $@ $<
$(if $(quiet),@echo " [HOSTCC] $@")
$(qexec)$(HOSTCC) -I. -I$(SRC_PATH_BARE) -o $@ $<
CLEAN-OBJS += obj_int_extract
#
@@ -255,7 +255,7 @@ ifeq ($(filter clean,$(MAKECMDGOALS)),)
endif
#
# Configuration dependant rules
# Configuration dependent rules
#
$(call pairmap,install_map_templates,$(INSTALL_MAPS))
@@ -332,7 +332,7 @@ ifneq ($(call enabled,DIST-SRCS),)
DIST-SRCS-$(CONFIG_MSVS) += build/x86-msvs/yasm.rules
DIST-SRCS-$(CONFIG_RVCT) += build/make/armlink_adapter.sh
#
# This isn't really ARCH_ARM dependent, it's dependant on whether we're
# This isn't really ARCH_ARM dependent, it's dependent on whether we're
# using assembly code or not (CONFIG_OPTIMIZATIONS maybe). Just use
# this for now.
DIST-SRCS-$(ARCH_ARM) += build/make/obj_int_extract.c

View File

@@ -83,7 +83,7 @@ Build options:
${toggle_werror} treat warnings as errors, if possible
(not available with all compilers)
${toggle_optimizations} turn on/off compiler optimization flags
${toggle_pic} turn on/off Position Independant Code
${toggle_pic} turn on/off Position Independent Code
${toggle_ccache} turn on/off compiler cache
${toggle_debug} enable/disable debug mode
${toggle_gprof} enable/disable gprof profiling instrumentation
@@ -624,6 +624,10 @@ process_common_toolchain() {
# Handle Solaris variants. Solaris 10 needs -lposix4
case ${toolchain} in
sparc-solaris-*)
add_extralibs -lposix4
add_cflags "-DMUST_BE_ALIGNED"
;;
*-solaris-*)
add_extralibs -lposix4
;;
@@ -863,7 +867,7 @@ process_common_toolchain() {
setup_gnu_toolchain
add_cflags -use-msasm -use-asm
add_ldflags -i-static
enabled x86_64 && add_cflags -ipo -no-prec-div -static -xSSE3 -axSSE3
enabled x86_64 && add_cflags -ipo -no-prec-div -static -xSSE2 -axSSE2
enabled x86_64 && AR=xiar
case ${tune_cpu} in
atom*)
@@ -953,7 +957,7 @@ process_common_toolchain() {
enabled small && check_add_cflags -O2 || check_add_cflags -O3
fi
# Position Independant Code (PIC) support, for building relocatable
# Position Independent Code (PIC) support, for building relocatable
# shared objects
enabled gcc && enabled pic && check_add_cflags -fPIC

View File

@@ -32,7 +32,8 @@ Options:
--name=project_name Name of the project (required)
--proj-guid=GUID GUID to use for the project
--module-def=filename File containing export definitions (for DLLs)
--ver=version Version (7,8) of visual studio to generate for
--ver=version Version (7,8,9) of visual studio to generate for
--src-path-bare=dir Path to root of source tree
-Ipath/to/include Additional include directories
-DFLAG[=value] Preprocessor macros to define
-Lpath/to/lib Additional library search paths
@@ -132,7 +133,7 @@ generate_filter() {
open_tag Filter \
Name=$name \
Filter=$pats \
UniqueIdentifier=`generate_uuid`
UniqueIdentifier=`generate_uuid` \
file_list_sz=${#file_list[@]}
for i in ${!file_list[@]}; do
@@ -145,31 +146,21 @@ generate_filter() {
if [ "$pat" == "asm" ] && $asm_use_custom_step; then
for plat in "${platforms[@]}"; do
for cfg in Debug Release; do
open_tag FileConfiguration \
Name="${cfg}|${plat}"
open_tag FileConfiguration \
Name="${cfg}|${plat}" \
tag Tool \
Name="VCCustomBuildTool" \
Description="Assembling \$(InputFileName)" \
CommandLine="$(eval echo \$asm_${cfg}_cmdline)"\
Outputs="\$(InputName).obj"
CommandLine="$(eval echo \$asm_${cfg}_cmdline)" \
Outputs="\$(InputName).obj" \
close_tag FileConfiguration
done
done
fi
if [ "${f##*.}" == "cpp" ]; then
for plat in "${platforms[@]}"; do
for cfg in Debug Release; do
open_tag FileConfiguration \
Name="${cfg}|${plat}"
tag Tool \
Name="VCCLCompilerTool" \
CompileAs="2"
close_tag FileConfiguration
done
done
fi
close_tag File
close_tag File
break
fi
@@ -185,57 +176,63 @@ unset target
for opt in "$@"; do
optval="${opt#*=}"
case "$opt" in
--help|-h) show_help
;;
--target=*) target="${optval}"
;;
--out=*) outfile="$optval"
;;
--name=*) name="${optval}"
;;
--proj-guid=*) guid="${optval}"
;;
--module-def=*)
link_opts="${link_opts} ModuleDefinitionFile=${optval}"
;;
--exe) proj_kind="exe"
;;
--lib) proj_kind="lib"
;;
--static-crt) use_static_runtime=true
;;
--ver=*) vs_ver="$optval"
case $optval in
[789])
;;
*) die Unrecognized Visual Studio Version in $opt
;;
esac
;;
-I*) opt="${opt%/}"
incs="${incs}${incs:+;}&quot;${opt##-I}&quot;"
yasmincs="${yasmincs} ${opt}"
;;
-D*) defines="${defines}${defines:+;}${opt##-D}"
;;
-L*) # fudge . to $(OutDir)
if [ "${opt##-L}" == "." ]; then
libdirs="${libdirs}${libdirs:+;}&quot;\$(OutDir)&quot;"
else
# Also try directories for this platform/configuration
libdirs="${libdirs}${libdirs:+;}&quot;${opt##-L}&quot;"
libdirs="${libdirs}${libdirs:+;}&quot;${opt##-L}/\$(PlatformName)/\$(ConfigurationName)&quot;"
libdirs="${libdirs}${libdirs:+;}&quot;${opt##-L}/\$(PlatformName)&quot;"
fi
;;
-l*) libs="${libs}${libs:+ }${opt##-l}.lib"
;;
-*) die_unknown $opt
;;
*) file_list[${#file_list[@]}]="$opt"
case "$opt" in
*.asm) uses_asm=true;;
esac
--help|-h) show_help
;;
--target=*) target="${optval}"
;;
--out=*) outfile="$optval"
;;
--name=*) name="${optval}"
;;
--proj-guid=*) guid="${optval}"
;;
--module-def=*) link_opts="${link_opts} ModuleDefinitionFile=${optval}"
;;
--exe) proj_kind="exe"
;;
--lib) proj_kind="lib"
;;
--src-path-bare=*) src_path_bare="$optval"
;;
--static-crt) use_static_runtime=true
;;
--ver=*)
vs_ver="$optval"
case "$optval" in
[789])
;;
*) die Unrecognized Visual Studio Version in $opt
;;
esac
;;
-I*)
opt="${opt%/}"
incs="${incs}${incs:+;}&quot;${opt##-I}&quot;"
yasmincs="${yasmincs} ${opt}"
;;
-D*) defines="${defines}${defines:+;}${opt##-D}"
;;
-L*) # fudge . to $(OutDir)
if [ "${opt##-L}" == "." ]; then
libdirs="${libdirs}${libdirs:+;}&quot;\$(OutDir)&quot;"
else
# Also try directories for this platform/configuration
libdirs="${libdirs}${libdirs:+;}&quot;${opt##-L}&quot;"
libdirs="${libdirs}${libdirs:+;}&quot;${opt##-L}/\$(PlatformName)/\$(ConfigurationName)&quot;"
libdirs="${libdirs}${libdirs:+;}&quot;${opt##-L}/\$(PlatformName)&quot;"
fi
;;
-l*) libs="${libs}${libs:+ }${opt##-l}.lib"
;;
-*) die_unknown $opt
;;
*)
file_list[${#file_list[@]}]="$opt"
case "$opt" in
*.asm) uses_asm=true
;;
esac
;;
esac
done
outfile=${outfile:-/dev/stdout}
@@ -278,11 +275,7 @@ done
# List Keyword for this target
case "$target" in
x86*)
keyword="ManagedCProj"
;;
arm*|iwmmx*)
keyword="Win32Proj"
x86*) keyword="ManagedCProj"
;;
*) die "Unsupported target $target!"
esac
@@ -298,402 +291,255 @@ case "$target" in
asm_Debug_cmdline="yasm -Xvc -g cv8 -f \$(PlatformName) ${yasmincs} &quot;\$(InputPath)&quot;"
asm_Release_cmdline="yasm -Xvc -f \$(PlatformName) ${yasmincs} &quot;\$(InputPath)&quot;"
;;
arm*|iwmmx*)
case "${name}" in
obj_int_extract) platforms[0]="Win32"
;;
*) platforms[0]="Pocket PC 2003 (ARMV4)"
;;
esac
;;
*) die "Unsupported target $target!"
esac
# List Command-line Arguments for this target
case "$target" in
arm*|iwmmx*)
if [ "$name" == "example" ];then
ARGU="--codec vp6 --flipuv --progress _bnd.vp6"
fi
if [ "$name" == "xma" ];then
ARGU="--codec vp6 -h 240 -w 320 -v"
fi
;;
esac
generate_vcproj() {
case "$proj_kind" in
exe) vs_ConfigurationType=1
;;
*) vs_ConfigurationType=4
;;
exe) vs_ConfigurationType=1
;;
*) vs_ConfigurationType=4
;;
esac
echo "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>"
open_tag VisualStudioProject \
ProjectType="Visual C++" \
Version="${vs_ver_id}" \
Name="${name}" \
ProjectGUID="{${guid}}" \
RootNamespace="${name}" \
Keyword="${keyword}"
open_tag VisualStudioProject \
ProjectType="Visual C++" \
Version="${vs_ver_id}" \
Name="${name}" \
ProjectGUID="{${guid}}" \
RootNamespace="${name}" \
Keyword="${keyword}" \
open_tag Platforms
open_tag Platforms
for plat in "${platforms[@]}"; do
tag Platform Name="$plat"
tag Platform Name="$plat"
done
close_tag Platforms
open_tag ToolFiles
open_tag ToolFiles
case "$target" in
x86*) $uses_asm && tag ToolFile RelativePath="$self_dirname/../x86-msvs/yasm.rules"
;;
arm*|iwmmx*)
if [ "$name" == "vpx" ];then
case "$target" in
armv5*)
tag ToolFile RelativePath="$self_dirname/../arm-wince-vs8/armasmv5.rules"
;;
armv6*)
tag ToolFile RelativePath="$self_dirname/../arm-wince-vs8/armasmv6.rules"
;;
iwmmxt*)
tag ToolFile RelativePath="$self_dirname/../arm-wince-vs8/armasmxscale.rules"
;;
esac
fi
;;
esac
close_tag ToolFiles
open_tag Configurations
open_tag Configurations
for plat in "${platforms[@]}"; do
plat_no_ws=`echo $plat | sed 's/[^A-Za-z0-9_]/_/g'`
open_tag Configuration \
Name="Debug|$plat" \
OutputDirectory="\$(SolutionDir)$plat_no_ws/\$(ConfigurationName)" \
IntermediateDirectory="$plat_no_ws/\$(ConfigurationName)/${name}" \
ConfigurationType="$vs_ConfigurationType" \
CharacterSet="1"
if [ "$target" == "armv6-wince-vs8" ] || [ "$target" == "armv5te-wince-vs8" ] || [ "$target" == "iwmmxt-wince-vs8" ] || [ "$target" == "iwmmxt2-wince-vs8" ];then
case "$name" in
vpx) tag Tool \
Name="VCPreBuildEventTool" \
CommandLine="call obj_int_extract.bat \$(ConfigurationName)"
tag Tool \
Name="VCMIDLTool" \
TargetEnvironment="1"
tag Tool \
Name="VCCLCompilerTool" \
ExecutionBucket="7" \
Optimization="0" \
AdditionalIncludeDirectories="$incs" \
PreprocessorDefinitions="_DEBUG;_WIN32_WCE=\$(CEVER);UNDER_CE;\$(PLATFORMDEFINES);WINCE;DEBUG;_LIB;\$(ARCHFAM);\$(_ARCHFAM_);_UNICODE;UNICODE;" \
MinimalRebuild="true" \
RuntimeLibrary="1" \
BufferSecurityCheck="false" \
UsePrecompiledHeader="0" \
WarningLevel="3" \
DebugInformationFormat="1" \
CompileAs="1"
tag Tool \
Name="VCResourceCompilerTool" \
PreprocessorDefinitions="_DEBUG;_WIN32_WCE=\$(CEVER);UNDER_CE;\$(PLATFORMDEFINES)" \
Culture="1033" \
AdditionalIncludeDirectories="\$(IntDir)" \
;;
example|xma) tag Tool \
Name="VCCLCompilerTool" \
ExecutionBucket="7" \
Optimization="0" \
AdditionalIncludeDirectories="$incs" \
PreprocessorDefinitions="_DEBUG;_WIN32_WCE=\$(CEVER);UNDER_CE;\$(PLATFORMDEFINES);WINCE;DEBUG;_CONSOLE;\$(ARCHFAM);\$(_ARCHFAM_);_UNICODE;UNICODE;" \
MinimalRebuild="true" \
RuntimeLibrary="1" \
BufferSecurityCheck="false" \
UsePrecompiledHeader="0" \
WarningLevel="3" \
DebugInformationFormat="1" \
CompileAs="1"
tag Tool \
Name="VCResourceCompilerTool" \
PreprocessorDefinitions="_DEBUG;_WIN32_WCE=\$(CEVER);UNDER_CE;\$(PLATFORMDEFINES)" \
Culture="1033" \
AdditionalIncludeDirectories="\$(IntDir)" \
;;
obj_int_extract) tag Tool \
Name="VCCLCompilerTool" \
Optimization="0" \
AdditionalIncludeDirectories="$incs" \
PreprocessorDefinitions="WIN32;DEBUG;_CONSOLE" \
RuntimeLibrary="1" \
WarningLevel="3" \
DebugInformationFormat="1" \
;;
esac
fi
open_tag Configuration \
Name="Debug|$plat" \
OutputDirectory="\$(SolutionDir)$plat_no_ws/\$(ConfigurationName)" \
IntermediateDirectory="$plat_no_ws/\$(ConfigurationName)/${name}" \
ConfigurationType="$vs_ConfigurationType" \
CharacterSet="1" \
case "$target" in
x86*) tag Tool \
Name="VCCLCompilerTool" \
Optimization="0" \
AdditionalIncludeDirectories="$incs" \
PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;$defines" \
RuntimeLibrary="$debug_runtime" \
UsePrecompiledHeader="0" \
WarningLevel="3" \
DebugInformationFormat="1" \
Detect64BitPortabilityProblems="true" \
x86*)
case "$name" in
obj_int_extract)
tag Tool \
Name="VCCLCompilerTool" \
Optimization="0" \
AdditionalIncludeDirectories="$incs" \
PreprocessorDefinitions="WIN32;DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE" \
RuntimeLibrary="$debug_runtime" \
WarningLevel="3" \
Detect64BitPortabilityProblems="true" \
DebugInformationFormat="1" \
;;
vpx)
tag Tool \
Name="VCPreBuildEventTool" \
CommandLine="call obj_int_extract.bat $src_path_bare" \
$uses_asm && tag Tool Name="YASM" IncludePaths="$incs" Debug="1"
tag Tool \
Name="VCCLCompilerTool" \
Optimization="0" \
AdditionalIncludeDirectories="$incs" \
PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;$defines" \
RuntimeLibrary="$debug_runtime" \
UsePrecompiledHeader="0" \
WarningLevel="3" \
DebugInformationFormat="1" \
Detect64BitPortabilityProblems="true" \
$uses_asm && tag Tool Name="YASM" IncludePaths="$incs" Debug="1"
;;
*)
tag Tool \
Name="VCCLCompilerTool" \
Optimization="0" \
AdditionalIncludeDirectories="$incs" \
PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;$defines" \
RuntimeLibrary="$debug_runtime" \
UsePrecompiledHeader="0" \
WarningLevel="3" \
DebugInformationFormat="1" \
Detect64BitPortabilityProblems="true" \
$uses_asm && tag Tool Name="YASM" IncludePaths="$incs" Debug="1"
;;
esac
;;
esac
case "$proj_kind" in
exe)
case "$target" in
x86*) tag Tool \
Name="VCLinkerTool" \
AdditionalDependencies="$debug_libs \$(NoInherit)" \
AdditionalLibraryDirectories="$libdirs" \
GenerateDebugInformation="true" \
ProgramDatabaseFile="\$(OutDir)/${name}.pdb" \
;;
arm*|iwmmx*)
x86*)
case "$name" in
obj_int_extract) tag Tool \
Name="VCLinkerTool" \
OutputFile="${name}.exe" \
GenerateDebugInformation="true"
obj_int_extract)
tag Tool \
Name="VCLinkerTool" \
OutputFile="${name}.exe" \
GenerateDebugInformation="true" \
;;
*) tag Tool \
Name="VCLinkerTool" \
AdditionalDependencies="$debug_libs" \
OutputFile="\$(OutDir)/${name}.exe" \
LinkIncremental="2" \
AdditionalLibraryDirectories="${libdirs};&quot;..\lib/$plat_no_ws&quot;" \
DelayLoadDLLs="\$(NOINHERIT)" \
GenerateDebugInformation="true" \
ProgramDatabaseFile="\$(OutDir)/${name}.pdb" \
SubSystem="9" \
StackReserveSize="65536" \
StackCommitSize="4096" \
EntryPointSymbol="mainWCRTStartup" \
TargetMachine="3"
*)
tag Tool \
Name="VCLinkerTool" \
AdditionalDependencies="$debug_libs \$(NoInherit)" \
AdditionalLibraryDirectories="$libdirs" \
GenerateDebugInformation="true" \
ProgramDatabaseFile="\$(OutDir)/${name}.pdb" \
;;
esac
;;
;;
esac
;;
lib)
case "$target" in
arm*|iwmmx*) tag Tool \
Name="VCLibrarianTool" \
AdditionalOptions=" /subsystem:windowsce,4.20 /machine:ARM" \
OutputFile="\$(OutDir)/${name}.lib" \
;;
*) tag Tool \
Name="VCLibrarianTool" \
OutputFile="\$(OutDir)/${name}${lib_sfx}d.lib" \
;;
x86*)
tag Tool \
Name="VCLibrarianTool" \
OutputFile="\$(OutDir)/${name}${lib_sfx}d.lib" \
;;
esac
;;
dll) tag Tool \
Name="VCLinkerTool" \
AdditionalDependencies="\$(NoInherit)" \
LinkIncremental="2" \
GenerateDebugInformation="true" \
AssemblyDebug="1" \
TargetMachine="1" \
$link_opts
dll)
tag Tool \
Name="VCLinkerTool" \
AdditionalDependencies="\$(NoInherit)" \
LinkIncremental="2" \
GenerateDebugInformation="true" \
AssemblyDebug="1" \
TargetMachine="1" \
$link_opts \
;;
esac
if [ "$target" == "armv6-wince-vs8" ] || [ "$target" == "armv5te-wince-vs8" ] || [ "$target" == "iwmmxt-wince-vs8" ] || [ "$target" == "iwmmxt2-wince-vs8" ];then
case "$name" in
vpx) tag DeploymentTool \
ForceDirty="-1" \
RegisterOutput="0"
;;
example|xma) tag DeploymentTool \
ForceDirty="-1" \
RegisterOutput="0"
tag DebuggerTool \
Arguments="${ARGU}"
;;
esac
fi
close_tag Configuration
open_tag Configuration \
Name="Release|$plat" \
OutputDirectory="\$(SolutionDir)$plat_no_ws/\$(ConfigurationName)" \
IntermediateDirectory="$plat_no_ws/\$(ConfigurationName)/${name}" \
ConfigurationType="$vs_ConfigurationType" \
CharacterSet="1" \
WholeProgramOptimization="0"
open_tag Configuration \
Name="Release|$plat" \
OutputDirectory="\$(SolutionDir)$plat_no_ws/\$(ConfigurationName)" \
IntermediateDirectory="$plat_no_ws/\$(ConfigurationName)/${name}" \
ConfigurationType="$vs_ConfigurationType" \
CharacterSet="1" \
WholeProgramOptimization="0" \
if [ "$target" == "armv6-wince-vs8" ] || [ "$target" == "armv5te-wince-vs8" ] || [ "$target" == "iwmmxt-wince-vs8" ] || [ "$target" == "iwmmxt2-wince-vs8" ];then
case "$name" in
vpx) tag Tool \
Name="VCPreBuildEventTool" \
CommandLine="call obj_int_extract.bat \$(ConfigurationName)"
tag Tool \
Name="VCMIDLTool" \
TargetEnvironment="1"
tag Tool \
Name="VCCLCompilerTool" \
ExecutionBucket="7" \
Optimization="2" \
FavorSizeOrSpeed="1" \
AdditionalIncludeDirectories="$incs" \
PreprocessorDefinitions="NDEBUG;_WIN32_WCE=\$(CEVER);UNDER_CE;\$(PLATFORMDEFINES);WINCE;_LIB;\$(ARCHFAM);\$(_ARCHFAM_);_UNICODE;UNICODE;" \
RuntimeLibrary="0" \
BufferSecurityCheck="false" \
UsePrecompiledHeader="0" \
WarningLevel="3" \
DebugInformationFormat="0" \
CompileAs="1"
tag Tool \
Name="VCResourceCompilerTool" \
PreprocessorDefinitions="NDEBUG;_WIN32_WCE=\$(CEVER);UNDER_CE;\$(PLATFORMDEFINES)" \
Culture="1033" \
AdditionalIncludeDirectories="\$(IntDir)" \
;;
example|xma) tag Tool \
Name="VCCLCompilerTool" \
ExecutionBucket="7" \
Optimization="2" \
FavorSizeOrSpeed="1" \
AdditionalIncludeDirectories="$incs" \
PreprocessorDefinitions="NDEBUG;_WIN32_WCE=\$(CEVER);UNDER_CE;\$(PLATFORMDEFINES);WINCE;_CONSOLE;\$(ARCHFAM);\$(_ARCHFAM_);_UNICODE;UNICODE;" \
RuntimeLibrary="0" \
BufferSecurityCheck="false" \
UsePrecompiledHeader="0" \
WarningLevel="3" \
DebugInformationFormat="0" \
CompileAs="1"
tag Tool \
Name="VCResourceCompilerTool" \
PreprocessorDefinitions="NDEBUG;_WIN32_WCE=\$(CEVER);UNDER_CE;\$(PLATFORMDEFINES)" \
Culture="1033" \
AdditionalIncludeDirectories="\$(IntDir)" \
;;
obj_int_extract) tag Tool \
Name="VCCLCompilerTool" \
AdditionalIncludeDirectories="$incs" \
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" \
RuntimeLibrary="0" \
UsePrecompiledHeader="0" \
WarningLevel="3" \
Detect64BitPortabilityProblems="true" \
DebugInformationFormat="0" \
;;
esac
fi
case "$target" in
x86*)
case "$name" in
obj_int_extract)
tag Tool \
Name="VCCLCompilerTool" \
AdditionalIncludeDirectories="$incs" \
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE" \
RuntimeLibrary="$release_runtime" \
UsePrecompiledHeader="0" \
WarningLevel="3" \
Detect64BitPortabilityProblems="true" \
DebugInformationFormat="0" \
;;
vpx)
tag Tool \
Name="VCPreBuildEventTool" \
CommandLine="call obj_int_extract.bat $src_path_bare" \
case "$target" in
x86*) tag Tool \
Name="VCCLCompilerTool" \
AdditionalIncludeDirectories="$incs" \
PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;$defines" \
RuntimeLibrary="$release_runtime" \
UsePrecompiledHeader="0" \
WarningLevel="3" \
DebugInformationFormat="0" \
Detect64BitPortabilityProblems="true"
tag Tool \
Name="VCCLCompilerTool" \
AdditionalIncludeDirectories="$incs" \
PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;$defines" \
RuntimeLibrary="$release_runtime" \
UsePrecompiledHeader="0" \
WarningLevel="3" \
DebugInformationFormat="0" \
Detect64BitPortabilityProblems="true" \
$uses_asm && tag Tool Name="YASM" IncludePaths="$incs"
;;
$uses_asm && tag Tool Name="YASM" IncludePaths="$incs"
;;
*)
tag Tool \
Name="VCCLCompilerTool" \
AdditionalIncludeDirectories="$incs" \
PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;$defines" \
RuntimeLibrary="$release_runtime" \
UsePrecompiledHeader="0" \
WarningLevel="3" \
DebugInformationFormat="0" \
Detect64BitPortabilityProblems="true" \
$uses_asm && tag Tool Name="YASM" IncludePaths="$incs"
;;
esac
;;
esac
case "$proj_kind" in
exe)
case "$target" in
x86*) tag Tool \
Name="VCLinkerTool" \
AdditionalDependencies="$libs \$(NoInherit)" \
AdditionalLibraryDirectories="$libdirs" \
;;
arm*|iwmmx*)
x86*)
case "$name" in
obj_int_extract) tag Tool \
Name="VCLinkerTool" \
OutputFile="${name}.exe" \
LinkIncremental="1" \
GenerateDebugInformation="false" \
SubSystem="0" \
OptimizeReferences="0" \
EnableCOMDATFolding="0" \
TargetMachine="0"
obj_int_extract)
tag Tool \
Name="VCLinkerTool" \
OutputFile="${name}.exe" \
GenerateDebugInformation="true" \
;;
*) tag Tool \
Name="VCLinkerTool" \
AdditionalDependencies="$libs" \
OutputFile="\$(OutDir)/${name}.exe" \
LinkIncremental="1" \
AdditionalLibraryDirectories="${libdirs};&quot;..\lib/$plat_no_ws&quot;" \
DelayLoadDLLs="\$(NOINHERIT)" \
GenerateDebugInformation="true" \
ProgramDatabaseFile="\$(OutDir)/${name}.pdb" \
SubSystem="9" \
StackReserveSize="65536" \
StackCommitSize="4096" \
OptimizeReferences="2" \
EnableCOMDATFolding="2" \
EntryPointSymbol="mainWCRTStartup" \
TargetMachine="3"
*)
tag Tool \
Name="VCLinkerTool" \
AdditionalDependencies="$libs \$(NoInherit)" \
AdditionalLibraryDirectories="$libdirs" \
;;
esac
;;
;;
esac
;;
lib)
lib)
case "$target" in
arm*|iwmmx*) tag Tool \
Name="VCLibrarianTool" \
AdditionalOptions=" /subsystem:windowsce,4.20 /machine:ARM" \
OutputFile="\$(OutDir)/${name}.lib" \
;;
*) tag Tool \
Name="VCLibrarianTool" \
OutputFile="\$(OutDir)/${name}${lib_sfx}.lib" \
;;
esac
;;
dll) # note differences to debug version: LinkIncremental, AssemblyDebug
tag Tool \
Name="VCLinkerTool" \
AdditionalDependencies="\$(NoInherit)" \
LinkIncremental="1" \
GenerateDebugInformation="true" \
TargetMachine="1" \
$link_opts
esac
x86*)
tag Tool \
Name="VCLibrarianTool" \
OutputFile="\$(OutDir)/${name}${lib_sfx}.lib" \
if [ "$target" == "armv6-wince-vs8" ] || [ "$target" == "armv5te-wince-vs8" ] || [ "$target" == "iwmmxt-wince-vs8" ] || [ "$target" == "iwmmxt2-wince-vs8" ];then
case "$name" in
vpx) tag DeploymentTool \
ForceDirty="-1" \
RegisterOutput="0"
;;
example|xma) tag DeploymentTool \
ForceDirty="-1" \
RegisterOutput="0"
tag DebuggerTool \
Arguments="${ARGU}"
;;
esac
fi
;;
esac
;;
dll) # note differences to debug version: LinkIncremental, AssemblyDebug
tag Tool \
Name="VCLinkerTool" \
AdditionalDependencies="\$(NoInherit)" \
LinkIncremental="1" \
GenerateDebugInformation="true" \
TargetMachine="1" \
$link_opts \
;;
esac
close_tag Configuration
done
close_tag Configurations
open_tag Files
generate_filter srcs "Source Files" "cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
generate_filter hdrs "Header Files" "h;hpp;hxx;hm;inl;inc;xsd"
open_tag Files
generate_filter srcs "Source Files" "c;def;odl;idl;hpj;bat;asm;asmx"
generate_filter hdrs "Header Files" "h;hm;inl;inc;xsd"
generate_filter resrcs "Resource Files" "rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
generate_filter resrcs "Build Files" "mk"
close_tag Files

View File

@@ -139,9 +139,6 @@ process_global() {
echo "${indent}${proj_guid}.${config}.ActiveCfg = ${config}"
echo "${indent}${proj_guid}.${config}.Build.0 = ${config}"
if [ "$target" == "armv6-wince-vs8" ] || [ "$target" == "armv5te-wince-vs8" ] || [ "$target" == "iwmmxt-wince-vs8" ] || [ "$target" == "iwmmxt2-wince-vs8" ];then
echo "${indent}${proj_guid}.${config}.Deploy.0 = ${config}"
fi
done
IFS=${IFS_bak}
done

View File

@@ -14,7 +14,7 @@
#include "vpx_config.h"
#if defined(_MSC_VER)
#if defined(_MSC_VER) || defined(__MINGW32__)
#include <io.h>
#include <share.h>
#include "vpx/vpx_integer.h"
@@ -59,20 +59,47 @@ int parse_macho(uint8_t *base_buf, size_t sz)
struct mach_header header;
uint8_t *buf = base_buf;
int base_data_section = 0;
int bits = 0;
/* We can read in mach_header for 32 and 64 bit architectures
* because it's identical to mach_header_64 except for the last
* element (uint32_t reserved), which we don't use. Then, when
* we know which architecture we're looking at, increment buf
* appropriately.
*/
memcpy(&header, buf, sizeof(struct mach_header));
buf += sizeof(struct mach_header);
if (header.magic != MH_MAGIC)
if (header.magic == MH_MAGIC)
{
log_msg("Bad magic number for object file. 0x%x expected, 0x%x found.\n",
header.magic, MH_MAGIC);
goto bail;
if (header.cputype == CPU_TYPE_ARM
|| header.cputype == CPU_TYPE_X86)
{
bits = 32;
buf += sizeof(struct mach_header);
}
else
{
log_msg("Bad cputype for object file. Currently only tested for CPU_TYPE_[ARM|X86].\n");
goto bail;
}
}
if (header.cputype != CPU_TYPE_ARM)
else if (header.magic == MH_MAGIC_64)
{
log_msg("Bad cputype for object file. Currently only tested for CPU_TYPE_ARM.\n");
if (header.cputype == CPU_TYPE_X86_64)
{
bits = 64;
buf += sizeof(struct mach_header_64);
}
else
{
log_msg("Bad cputype for object file. Currently only tested for CPU_TYPE_X86_64.\n");
goto bail;
}
}
else
{
log_msg("Bad magic number for object file. 0x%x or 0x%x expected, 0x%x found.\n",
MH_MAGIC, MH_MAGIC_64, header.magic);
goto bail;
}
@@ -85,8 +112,6 @@ int parse_macho(uint8_t *base_buf, size_t sz)
for (i = 0; i < header.ncmds; i++)
{
struct load_command lc;
struct symtab_command sc;
struct segment_command seg_c;
memcpy(&lc, buf, sizeof(struct load_command));
@@ -94,50 +119,99 @@ int parse_macho(uint8_t *base_buf, size_t sz)
{
uint8_t *seg_buf = buf;
struct section s;
struct segment_command seg_c;
memcpy(&seg_c, buf, sizeof(struct segment_command));
memcpy(&seg_c, seg_buf, sizeof(struct segment_command));
seg_buf += sizeof(struct segment_command);
for (j = 0; j < seg_c.nsects; j++)
/* Although each section is given it's own offset, nlist.n_value
* references the offset of the first section. This isn't
* apparent without debug information because the offset of the
* data section is the same as the first section. However, with
* debug sections mixed in, the offset of the debug section
* increases but n_value still references the first section.
*/
if (seg_c.nsects < 1)
{
memcpy(&s, seg_buf + (j * sizeof(struct section)), sizeof(struct section));
// Need to get this offset which is the start of the symbol table
// before matching the strings up with symbols.
base_data_section = s.offset;
log_msg("Not enough sections\n");
goto bail;
}
memcpy(&s, seg_buf, sizeof(struct section));
base_data_section = s.offset;
}
else if (lc.cmd == LC_SEGMENT_64)
{
uint8_t *seg_buf = buf;
struct section_64 s;
struct segment_command_64 seg_c;
memcpy(&seg_c, seg_buf, sizeof(struct segment_command_64));
seg_buf += sizeof(struct segment_command_64);
/* Explanation in LG_SEGMENT */
if (seg_c.nsects < 1)
{
log_msg("Not enough sections\n");
goto bail;
}
memcpy(&s, seg_buf, sizeof(struct section_64));
base_data_section = s.offset;
}
else if (lc.cmd == LC_SYMTAB)
{
uint8_t *sym_buf = base_buf;
uint8_t *str_buf = base_buf;
if (base_data_section != 0)
{
struct symtab_command sc;
uint8_t *sym_buf = base_buf;
uint8_t *str_buf = base_buf;
memcpy(&sc, buf, sizeof(struct symtab_command));
if (sc.cmdsize != sizeof(struct symtab_command))
{
log_msg("Can't find symbol table!\n");
goto bail;
}
sym_buf += sc.symoff;
str_buf += sc.stroff;
for (j = 0; j < sc.nsyms; j++)
{
struct nlist nl;
int val;
/* Location of string is cacluated each time from the
* start of the string buffer. On darwin the symbols
* are prefixed by "_", so we bump the pointer by 1.
* The target value is defined as an int in asm_*_offsets.c,
* which is 4 bytes on all targets we currently use.
*/
if (bits == 32)
{
struct nlist nl;
int val;
memcpy(&nl, sym_buf + (j * sizeof(struct nlist)), sizeof(struct nlist));
memcpy(&nl, sym_buf, sizeof(struct nlist));
sym_buf += sizeof(struct nlist);
val = *((int *)(base_buf + base_data_section + nl.n_value));
memcpy(&val, base_buf + base_data_section + nl.n_value,
sizeof(val));
printf("%-40s EQU %5d\n",
str_buf + nl.n_un.n_strx + 1, val);
}
else /* if (bits == 64) */
{
struct nlist_64 nl;
int val;
// Location of string is cacluated each time from the
// start of the string buffer. On darwin the symbols
// are prefixed by "_". On other platforms it is not
// so it needs to be removed. That is the reason for
// the +1.
printf("%-40s EQU %5d\n", str_buf + nl.n_un.n_strx + 1, val);
memcpy(&nl, sym_buf, sizeof(struct nlist_64));
sym_buf += sizeof(struct nlist_64);
memcpy(&val, base_buf + base_data_section + nl.n_value,
sizeof(val));
printf("%-40s EQU %5d\n",
str_buf + nl.n_un.n_strx + 1, val);
}
}
}
}
@@ -218,7 +292,7 @@ bail:
return EXIT_FAILURE;
}
#else
#elif defined(__ELF__)
#include "elf.h"
#define COPY_STRUCT(dst, buf, ofst, sz) do {\
@@ -237,212 +311,420 @@ bail:
typedef struct
{
uint8_t *buf; /* Buffer containing ELF data */
size_t sz; /* Buffer size */
int le_data; /* Data is little-endian */
Elf32_Ehdr hdr;
uint8_t *buf; /* Buffer containing ELF data */
size_t sz; /* Buffer size */
int le_data; /* Data is little-endian */
unsigned char e_ident[EI_NIDENT]; /* Magic number and other info */
int bits; /* 32 or 64 */
Elf32_Ehdr hdr32;
Elf64_Ehdr hdr64;
} elf_obj_t;
int parse_elf32_header(elf_obj_t *elf)
int parse_elf_header(elf_obj_t *elf)
{
int res;
/* Verify ELF32 header */
COPY_STRUCT(&elf->hdr, elf->buf, 0, elf->sz);
res = elf->hdr.e_ident[EI_MAG0] == ELFMAG0;
res &= elf->hdr.e_ident[EI_MAG1] == ELFMAG1;
res &= elf->hdr.e_ident[EI_MAG2] == ELFMAG2;
res &= elf->hdr.e_ident[EI_MAG3] == ELFMAG3;
res &= elf->hdr.e_ident[EI_CLASS] == ELFCLASS32;
res &= elf->hdr.e_ident[EI_DATA] == ELFDATA2LSB
|| elf->hdr.e_ident[EI_DATA] == ELFDATA2MSB;
/* Verify ELF Magic numbers */
COPY_STRUCT(&elf->e_ident, elf->buf, 0, elf->sz);
res = elf->e_ident[EI_MAG0] == ELFMAG0;
res &= elf->e_ident[EI_MAG1] == ELFMAG1;
res &= elf->e_ident[EI_MAG2] == ELFMAG2;
res &= elf->e_ident[EI_MAG3] == ELFMAG3;
res &= elf->e_ident[EI_CLASS] == ELFCLASS32
|| elf->e_ident[EI_CLASS] == ELFCLASS64;
res &= elf->e_ident[EI_DATA] == ELFDATA2LSB;
if (!res) goto bail;
elf->le_data = elf->hdr.e_ident[EI_DATA] == ELFDATA2LSB;
elf->le_data = elf->e_ident[EI_DATA] == ELFDATA2LSB;
ENDIAN_ASSIGN_IN_PLACE(elf->hdr.e_type);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr.e_machine);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr.e_version);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr.e_entry);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr.e_phoff);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr.e_shoff);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr.e_flags);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr.e_ehsize);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr.e_phentsize);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr.e_phnum);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr.e_shentsize);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr.e_shnum);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr.e_shstrndx);
return 0;
bail:
return 1;
}
int parse_elf32_section(elf_obj_t *elf, int idx, Elf32_Shdr *hdr)
{
if (idx >= elf->hdr.e_shnum)
goto bail;
COPY_STRUCT(hdr, elf->buf, elf->hdr.e_shoff + idx * elf->hdr.e_shentsize,
elf->sz);
ENDIAN_ASSIGN_IN_PLACE(hdr->sh_name);
ENDIAN_ASSIGN_IN_PLACE(hdr->sh_type);
ENDIAN_ASSIGN_IN_PLACE(hdr->sh_flags);
ENDIAN_ASSIGN_IN_PLACE(hdr->sh_addr);
ENDIAN_ASSIGN_IN_PLACE(hdr->sh_offset);
ENDIAN_ASSIGN_IN_PLACE(hdr->sh_size);
ENDIAN_ASSIGN_IN_PLACE(hdr->sh_link);
ENDIAN_ASSIGN_IN_PLACE(hdr->sh_info);
ENDIAN_ASSIGN_IN_PLACE(hdr->sh_addralign);
ENDIAN_ASSIGN_IN_PLACE(hdr->sh_entsize);
return 0;
bail:
return 1;
}
char *parse_elf32_string_table(elf_obj_t *elf, int s_idx, int idx)
{
Elf32_Shdr shdr;
if (parse_elf32_section(elf, s_idx, &shdr))
/* Read in relevant values */
if (elf->e_ident[EI_CLASS] == ELFCLASS32)
{
log_msg("Failed to parse ELF string table: section %d, index %d\n",
s_idx, idx);
return "";
elf->bits = 32;
COPY_STRUCT(&elf->hdr32, elf->buf, 0, elf->sz);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr32.e_type);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr32.e_machine);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr32.e_version);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr32.e_entry);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr32.e_phoff);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr32.e_shoff);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr32.e_flags);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr32.e_ehsize);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr32.e_phentsize);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr32.e_phnum);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr32.e_shentsize);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr32.e_shnum);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr32.e_shstrndx);
}
else /* if (elf->e_ident[EI_CLASS] == ELFCLASS64) */
{
elf->bits = 64;
COPY_STRUCT(&elf->hdr64, elf->buf, 0, elf->sz);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr64.e_type);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr64.e_machine);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr64.e_version);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr64.e_entry);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr64.e_phoff);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr64.e_shoff);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr64.e_flags);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr64.e_ehsize);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr64.e_phentsize);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr64.e_phnum);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr64.e_shentsize);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr64.e_shnum);
ENDIAN_ASSIGN_IN_PLACE(elf->hdr64.e_shstrndx);
}
return (char *)(elf->buf + shdr.sh_offset + idx);
return 0;
bail:
log_msg("Failed to parse ELF file header");
return 1;
}
int parse_elf32_symbol(elf_obj_t *elf, unsigned int ofst, Elf32_Sym *sym)
int parse_elf_section(elf_obj_t *elf, int idx, Elf32_Shdr *hdr32, Elf64_Shdr *hdr64)
{
COPY_STRUCT(sym, elf->buf, ofst, elf->sz);
ENDIAN_ASSIGN_IN_PLACE(sym->st_name);
ENDIAN_ASSIGN_IN_PLACE(sym->st_value);
ENDIAN_ASSIGN_IN_PLACE(sym->st_size);
ENDIAN_ASSIGN_IN_PLACE(sym->st_info);
ENDIAN_ASSIGN_IN_PLACE(sym->st_other);
ENDIAN_ASSIGN_IN_PLACE(sym->st_shndx);
if (hdr32)
{
if (idx >= elf->hdr32.e_shnum)
goto bail;
COPY_STRUCT(hdr32, elf->buf, elf->hdr32.e_shoff + idx * elf->hdr32.e_shentsize,
elf->sz);
ENDIAN_ASSIGN_IN_PLACE(hdr32->sh_name);
ENDIAN_ASSIGN_IN_PLACE(hdr32->sh_type);
ENDIAN_ASSIGN_IN_PLACE(hdr32->sh_flags);
ENDIAN_ASSIGN_IN_PLACE(hdr32->sh_addr);
ENDIAN_ASSIGN_IN_PLACE(hdr32->sh_offset);
ENDIAN_ASSIGN_IN_PLACE(hdr32->sh_size);
ENDIAN_ASSIGN_IN_PLACE(hdr32->sh_link);
ENDIAN_ASSIGN_IN_PLACE(hdr32->sh_info);
ENDIAN_ASSIGN_IN_PLACE(hdr32->sh_addralign);
ENDIAN_ASSIGN_IN_PLACE(hdr32->sh_entsize);
}
else /* if (hdr64) */
{
if (idx >= elf->hdr64.e_shnum)
goto bail;
COPY_STRUCT(hdr64, elf->buf, elf->hdr64.e_shoff + idx * elf->hdr64.e_shentsize,
elf->sz);
ENDIAN_ASSIGN_IN_PLACE(hdr64->sh_name);
ENDIAN_ASSIGN_IN_PLACE(hdr64->sh_type);
ENDIAN_ASSIGN_IN_PLACE(hdr64->sh_flags);
ENDIAN_ASSIGN_IN_PLACE(hdr64->sh_addr);
ENDIAN_ASSIGN_IN_PLACE(hdr64->sh_offset);
ENDIAN_ASSIGN_IN_PLACE(hdr64->sh_size);
ENDIAN_ASSIGN_IN_PLACE(hdr64->sh_link);
ENDIAN_ASSIGN_IN_PLACE(hdr64->sh_info);
ENDIAN_ASSIGN_IN_PLACE(hdr64->sh_addralign);
ENDIAN_ASSIGN_IN_PLACE(hdr64->sh_entsize);
}
return 0;
bail:
return 1;
}
int parse_elf32(uint8_t *buf, size_t sz, output_fmt_t mode)
char *parse_elf_string_table(elf_obj_t *elf, int s_idx, int idx)
{
elf_obj_t elf;
Elf32_Shdr shdr;
if (elf->bits == 32)
{
Elf32_Shdr shdr;
if (parse_elf_section(elf, s_idx, &shdr, NULL))
{
log_msg("Failed to parse ELF string table: section %d, index %d\n",
s_idx, idx);
return "";
}
return (char *)(elf->buf + shdr.sh_offset + idx);
}
else /* if (elf->bits == 64) */
{
Elf64_Shdr shdr;
if (parse_elf_section(elf, s_idx, NULL, &shdr))
{
log_msg("Failed to parse ELF string table: section %d, index %d\n",
s_idx, idx);
return "";
}
return (char *)(elf->buf + shdr.sh_offset + idx);
}
}
int parse_elf_symbol(elf_obj_t *elf, unsigned int ofst, Elf32_Sym *sym32, Elf64_Sym *sym64)
{
if (sym32)
{
COPY_STRUCT(sym32, elf->buf, ofst, elf->sz);
ENDIAN_ASSIGN_IN_PLACE(sym32->st_name);
ENDIAN_ASSIGN_IN_PLACE(sym32->st_value);
ENDIAN_ASSIGN_IN_PLACE(sym32->st_size);
ENDIAN_ASSIGN_IN_PLACE(sym32->st_info);
ENDIAN_ASSIGN_IN_PLACE(sym32->st_other);
ENDIAN_ASSIGN_IN_PLACE(sym32->st_shndx);
}
else /* if (sym64) */
{
COPY_STRUCT(sym64, elf->buf, ofst, elf->sz);
ENDIAN_ASSIGN_IN_PLACE(sym64->st_name);
ENDIAN_ASSIGN_IN_PLACE(sym64->st_value);
ENDIAN_ASSIGN_IN_PLACE(sym64->st_size);
ENDIAN_ASSIGN_IN_PLACE(sym64->st_info);
ENDIAN_ASSIGN_IN_PLACE(sym64->st_other);
ENDIAN_ASSIGN_IN_PLACE(sym64->st_shndx);
}
return 0;
bail:
return 1;
}
int parse_elf(uint8_t *buf, size_t sz, output_fmt_t mode)
{
elf_obj_t elf;
unsigned int ofst;
int i;
Elf32_Off strtab_off; /* save String Table offset for later use */
int i;
Elf32_Off strtab_off32;
Elf64_Off strtab_off64; /* save String Table offset for later use */
memset(&elf, 0, sizeof(elf));
elf.buf = buf;
elf.sz = sz;
/* Parse Header */
if (parse_elf32_header(&elf))
{
log_msg("Parse error: File does not appear to be valid ELF32\n");
return 1;
}
if (parse_elf_header(&elf))
goto bail;
for (i = 0; i < elf.hdr.e_shnum; i++)
if (elf.bits == 32)
{
parse_elf32_section(&elf, i, &shdr);
if (shdr.sh_type == SHT_STRTAB)
Elf32_Shdr shdr;
for (i = 0; i < elf.hdr32.e_shnum; i++)
{
char strtsb_name[128];
parse_elf_section(&elf, i, &shdr, NULL);
strcpy(strtsb_name, (char *)(elf.buf + shdr.sh_offset + shdr.sh_name));
if (!(strcmp(strtsb_name, ".shstrtab")))
if (shdr.sh_type == SHT_STRTAB)
{
log_msg("found section: %s\n", strtsb_name);
strtab_off = shdr.sh_offset;
break;
char strtsb_name[128];
strcpy(strtsb_name, (char *)(elf.buf + shdr.sh_offset + shdr.sh_name));
if (!(strcmp(strtsb_name, ".shstrtab")))
{
/* log_msg("found section: %s\n", strtsb_name); */
strtab_off32 = shdr.sh_offset;
break;
}
}
}
}
else /* if (elf.bits == 64) */
{
Elf64_Shdr shdr;
for (i = 0; i < elf.hdr64.e_shnum; i++)
{
parse_elf_section(&elf, i, NULL, &shdr);
if (shdr.sh_type == SHT_STRTAB)
{
char strtsb_name[128];
strcpy(strtsb_name, (char *)(elf.buf + shdr.sh_offset + shdr.sh_name));
if (!(strcmp(strtsb_name, ".shstrtab")))
{
/* log_msg("found section: %s\n", strtsb_name); */
strtab_off64 = shdr.sh_offset;
break;
}
}
}
}
/* Parse all Symbol Tables */
for (i = 0; i < elf.hdr.e_shnum; i++)
if (elf.bits == 32)
{
parse_elf32_section(&elf, i, &shdr);
if (shdr.sh_type == SHT_SYMTAB)
Elf32_Shdr shdr;
for (i = 0; i < elf.hdr32.e_shnum; i++)
{
for (ofst = shdr.sh_offset;
ofst < shdr.sh_offset + shdr.sh_size;
ofst += shdr.sh_entsize)
parse_elf_section(&elf, i, &shdr, NULL);
if (shdr.sh_type == SHT_SYMTAB)
{
Elf32_Sym sym;
parse_elf32_symbol(&elf, ofst, &sym);
/* For all OBJECTS (data objects), extract the value from the
* proper data segment.
*/
if (ELF32_ST_TYPE(sym.st_info) == STT_OBJECT && sym.st_name)
log_msg("found data object %s\n",
parse_elf32_string_table(&elf,
shdr.sh_link,
sym.st_name));
if (ELF32_ST_TYPE(sym.st_info) == STT_OBJECT
&& sym.st_size == 4)
for (ofst = shdr.sh_offset;
ofst < shdr.sh_offset + shdr.sh_size;
ofst += shdr.sh_entsize)
{
Elf32_Shdr dhdr;
int32_t val;
char section_name[128];
Elf32_Sym sym;
parse_elf32_section(&elf, sym.st_shndx, &dhdr);
parse_elf_symbol(&elf, ofst, &sym, NULL);
/* For explanition - refer to _MSC_VER version of code */
strcpy(section_name, (char *)(elf.buf + strtab_off + dhdr.sh_name));
log_msg("Section_name: %s, Section_type: %d\n", section_name, dhdr.sh_type);
/* For all OBJECTS (data objects), extract the value from the
* proper data segment.
*/
/* if (ELF32_ST_TYPE(sym.st_info) == STT_OBJECT && sym.st_name)
log_msg("found data object %s\n",
parse_elf_string_table(&elf,
shdr.sh_link,
sym.st_name));
*/
if (!(strcmp(section_name, ".bss")))
if (ELF32_ST_TYPE(sym.st_info) == STT_OBJECT
&& sym.st_size == 4)
{
val = 0;
}
else
{
memcpy(&val,
elf.buf + dhdr.sh_offset + sym.st_value,
sizeof(val));
Elf32_Shdr dhdr;
int val = 0;
char section_name[128];
parse_elf_section(&elf, sym.st_shndx, &dhdr, NULL);
/* For explanition - refer to _MSC_VER version of code */
strcpy(section_name, (char *)(elf.buf + strtab_off32 + dhdr.sh_name));
/* log_msg("Section_name: %s, Section_type: %d\n", section_name, dhdr.sh_type); */
if (strcmp(section_name, ".bss"))
{
if (sizeof(val) != sym.st_size)
{
/* The target value is declared as an int in
* asm_*_offsets.c, which is 4 bytes on all
* targets we currently use. Complain loudly if
* this is not true.
*/
log_msg("Symbol size is wrong\n");
goto bail;
}
memcpy(&val,
elf.buf + dhdr.sh_offset + sym.st_value,
sym.st_size);
}
if (!elf.le_data)
{
log_msg("Big Endian data not supported yet!\n");
goto bail;
}
switch (mode)
{
case OUTPUT_FMT_RVDS:
printf("%-40s EQU %5d\n",
parse_elf_string_table(&elf,
shdr.sh_link,
sym.st_name),
val);
break;
case OUTPUT_FMT_GAS:
printf(".equ %-40s, %5d\n",
parse_elf_string_table(&elf,
shdr.sh_link,
sym.st_name),
val);
break;
default:
printf("%s = %d\n",
parse_elf_string_table(&elf,
shdr.sh_link,
sym.st_name),
val);
}
}
}
}
}
}
else /* if (elf.bits == 64) */
{
Elf64_Shdr shdr;
for (i = 0; i < elf.hdr64.e_shnum; i++)
{
parse_elf_section(&elf, i, NULL, &shdr);
if (!elf.le_data)
{
log_msg("Big Endian data not supported yet!\n");
goto bail;
}\
if (shdr.sh_type == SHT_SYMTAB)
{
for (ofst = shdr.sh_offset;
ofst < shdr.sh_offset + shdr.sh_size;
ofst += shdr.sh_entsize)
{
Elf64_Sym sym;
switch (mode)
parse_elf_symbol(&elf, ofst, NULL, &sym);
/* For all OBJECTS (data objects), extract the value from the
* proper data segment.
*/
/* if (ELF64_ST_TYPE(sym.st_info) == STT_OBJECT && sym.st_name)
log_msg("found data object %s\n",
parse_elf_string_table(&elf,
shdr.sh_link,
sym.st_name));
*/
if (ELF64_ST_TYPE(sym.st_info) == STT_OBJECT
&& sym.st_size == 4)
{
case OUTPUT_FMT_RVDS:
printf("%-40s EQU %5d\n",
parse_elf32_string_table(&elf,
shdr.sh_link,
sym.st_name),
val);
break;
case OUTPUT_FMT_GAS:
printf(".equ %-40s, %5d\n",
parse_elf32_string_table(&elf,
shdr.sh_link,
sym.st_name),
val);
break;
default:
printf("%s = %d\n",
parse_elf32_string_table(&elf,
shdr.sh_link,
sym.st_name),
val);
Elf64_Shdr dhdr;
int val = 0;
char section_name[128];
parse_elf_section(&elf, sym.st_shndx, NULL, &dhdr);
/* For explanition - refer to _MSC_VER version of code */
strcpy(section_name, (char *)(elf.buf + strtab_off64 + dhdr.sh_name));
/* log_msg("Section_name: %s, Section_type: %d\n", section_name, dhdr.sh_type); */
if ((strcmp(section_name, ".bss")))
{
if (sizeof(val) != sym.st_size)
{
/* The target value is declared as an int in
* asm_*_offsets.c, which is 4 bytes on all
* targets we currently use. Complain loudly if
* this is not true.
*/
log_msg("Symbol size is wrong\n");
goto bail;
}
memcpy(&val,
elf.buf + dhdr.sh_offset + sym.st_value,
sym.st_size);
}
if (!elf.le_data)
{
log_msg("Big Endian data not supported yet!\n");
goto bail;
}
switch (mode)
{
case OUTPUT_FMT_RVDS:
printf("%-40s EQU %5d\n",
parse_elf_string_table(&elf,
shdr.sh_link,
sym.st_name),
val);
break;
case OUTPUT_FMT_GAS:
printf(".equ %-40s, %5d\n",
parse_elf_string_table(&elf,
shdr.sh_link,
sym.st_name),
val);
break;
default:
printf("%s = %d\n",
parse_elf_string_table(&elf,
shdr.sh_link,
sym.st_name),
val);
}
}
}
}
@@ -454,7 +736,7 @@ int parse_elf32(uint8_t *buf, size_t sz, output_fmt_t mode)
return 0;
bail:
log_msg("Parse error: File does not appear to be valid ELF32\n");
log_msg("Parse error: File does not appear to be valid ELF32 or ELF64\n");
return 1;
}
@@ -521,8 +803,7 @@ int main(int argc, char **argv)
goto bail;
}
res = parse_elf32(file_buf, stat_buf.st_size, mode);
//res = parse_coff(file_buf, stat_buf.st_size);
res = parse_elf(file_buf, stat_buf.st_size, mode);
free(file_buf);
if (!res)
@@ -535,7 +816,7 @@ bail:
#endif
#if defined(_MSC_VER)
#if defined(_MSC_VER) || defined(__MINGW32__)
/* See "Microsoft Portable Executable and Common Object File Format Specification"
for reference.
*/
@@ -549,7 +830,6 @@ int parse_coff(unsigned __int8 *buf, size_t sz)
unsigned int i;
unsigned __int8 *ptr;
unsigned __int32 symoffset;
FILE *fp;
char **sectionlist; //this array holds all section names in their correct order.
//it is used to check if the symbol is in .bss or .data section.
@@ -560,9 +840,18 @@ int parse_coff(unsigned __int8 *buf, size_t sz)
strtab_ptr = symtab_ptr + symtab_sz * 18;
if (nsections > 96)
goto bail;
{
log_msg("Too many sections\n");
return 1;
}
sectionlist = malloc(nsections * sizeof * sectionlist);
sectionlist = malloc(nsections * sizeof(sectionlist));
if (sectionlist == NULL)
{
log_msg("Allocating first level of section list failed\n");
return 1;
}
//log_msg("COFF: Found %u symbols in %u sections.\n", symtab_sz, nsections);
@@ -580,6 +869,12 @@ int parse_coff(unsigned __int8 *buf, size_t sz)
//log_msg("COFF: Parsing section %s\n",sectionname);
sectionlist[i] = malloc(strlen(sectionname) + 1);
if (sectionlist[i] == NULL)
{
log_msg("Allocating storage for %s failed\n", sectionname);
goto bail;
}
strcpy(sectionlist[i], sectionname);
if (!strcmp(sectionname, ".data")) sectionrawdata_ptr = get_le32(ptr + 20);
@@ -590,14 +885,6 @@ int parse_coff(unsigned __int8 *buf, size_t sz)
//log_msg("COFF: Symbol table at offset %u\n", symtab_ptr);
//log_msg("COFF: raw data pointer ofset for section .data is %u\n", sectionrawdata_ptr);
fp = fopen("assembly_offsets.asm", "w");
if (fp == NULL)
{
perror("open file");
goto bail;
}
/* The compiler puts the data with non-zero offset in .data section, but puts the data with
zero offset in .bss section. So, if the data in in .bss section, set offset=0.
Note from Wiki: In an object module compiled from C, the bss section contains
@@ -631,13 +918,23 @@ int parse_coff(unsigned __int8 *buf, size_t sz)
char name[9] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
strncpy(name, ptr, 8);
//log_msg("COFF: Parsing symbol %s\n",name);
fprintf(fp, "%-40s EQU ", name);
/* The 64bit Windows compiler doesn't prefix with an _.
* Check what's there, and bump if necessary
*/
if (name[0] == '_')
printf("%-40s EQU ", name + 1);
else
printf("%-40s EQU ", name);
}
else
{
//log_msg("COFF: Parsing symbol %s\n",
// buf + strtab_ptr + get_le32(ptr+4));
fprintf(fp, "%-40s EQU ", buf + strtab_ptr + get_le32(ptr + 4));
if ((buf + strtab_ptr + get_le32(ptr + 4))[0] == '_')
printf("%-40s EQU ",
buf + strtab_ptr + get_le32(ptr + 4) + 1);
else
printf("%-40s EQU ", buf + strtab_ptr + get_le32(ptr + 4));
}
if (!(strcmp(sectionlist[section-1], ".bss")))
@@ -654,14 +951,13 @@ int parse_coff(unsigned __int8 *buf, size_t sz)
//log_msg(" Address: %u\n",get_le32(ptr+8));
//log_msg(" Offset: %u\n", symoffset);
fprintf(fp, "%5d\n", symoffset);
printf("%5d\n", symoffset);
}
ptr += 18;
}
fprintf(fp, " END\n");
fclose(fp);
printf(" END\n");
for (i = 0; i < nsections; i++)
{
@@ -711,11 +1007,7 @@ int main(int argc, char **argv)
else
f = argv[1];
if (_sopen_s(&fd, f, _O_BINARY, _SH_DENYNO, _S_IREAD | _S_IWRITE))
{
perror("Unable to open file");
goto bail;
}
fd = _sopen(f, _O_BINARY, _SH_DENYNO, _S_IREAD | _S_IWRITE);
if (_fstat(fd, &stat_buf))
{

View File

@@ -0,0 +1,15 @@
REM Copyright (c) 2011 The WebM project authors. All Rights Reserved.
REM
REM Use of this source code is governed by a BSD-style license
REM that can be found in the LICENSE file in the root of the source
REM tree. An additional intellectual property rights grant can be found
REM in the file PATENTS. All contributing project authors may
REM be found in the AUTHORS file in the root of the source tree.
echo on
cl /I "./" /I "%1" /nologo /c "%1/vp8/common/asm_com_offsets.c"
cl /I "./" /I "%1" /nologo /c "%1/vp8/decoder/asm_dec_offsets.c"
cl /I "./" /I "%1" /nologo /c "%1/vp8/encoder/asm_enc_offsets.c"
obj_int_extract.exe rvds "asm_com_offsets.obj" > "asm_com_offsets.asm"
obj_int_extract.exe rvds "asm_dec_offsets.obj" > "asm_dec_offsets.asm"
obj_int_extract.exe rvds "asm_enc_offsets.obj" > "asm_enc_offsets.asm"

4
configure vendored
View File

@@ -80,19 +80,15 @@ all_platforms="${all_platforms} armv5te-linux-rvct"
all_platforms="${all_platforms} armv5te-linux-gcc"
all_platforms="${all_platforms} armv5te-none-rvct"
all_platforms="${all_platforms} armv5te-symbian-gcc"
all_platforms="${all_platforms} armv5te-wince-vs8"
all_platforms="${all_platforms} armv6-darwin-gcc"
all_platforms="${all_platforms} armv6-linux-rvct"
all_platforms="${all_platforms} armv6-linux-gcc"
all_platforms="${all_platforms} armv6-none-rvct"
all_platforms="${all_platforms} armv6-symbian-gcc"
all_platforms="${all_platforms} armv6-wince-vs8"
all_platforms="${all_platforms} iwmmxt-linux-rvct"
all_platforms="${all_platforms} iwmmxt-linux-gcc"
all_platforms="${all_platforms} iwmmxt-wince-vs8"
all_platforms="${all_platforms} iwmmxt2-linux-rvct"
all_platforms="${all_platforms} iwmmxt2-linux-gcc"
all_platforms="${all_platforms} iwmmxt2-wince-vs8"
all_platforms="${all_platforms} armv7-darwin-gcc" #neon Cortex-A8
all_platforms="${all_platforms} armv7-linux-rvct" #neon Cortex-A8
all_platforms="${all_platforms} armv7-linux-gcc" #neon Cortex-A8

View File

@@ -34,7 +34,8 @@ TXT_DOX = $(call enabled,TXT_DOX)
EXAMPLE_PATH += $(SRC_PATH_BARE) #for CHANGELOG, README, etc
doxyfile: libs.doxy_template libs.doxy examples.doxy
doxyfile: $(if $(findstring examples, $(ALL_TARGETS)),examples.doxy)
doxyfile: libs.doxy_template libs.doxy
@echo " [CREATE] $@"
@cat $^ > $@
@echo "STRIP_FROM_PATH += $(SRC_PATH_BARE) $(BUILD_ROOT)" >> $@

View File

@@ -19,7 +19,7 @@
#define VPX_CODEC_DISABLE_COMPAT 1
#include "vpx/vpx_decoder.h"
#include "vpx/vp8dx.h"
#define interface (&vpx_codec_vp8_dx_algo)
#define interface (vpx_codec_vp8_dx())
@EXTRA_INCLUDES

View File

@@ -2,7 +2,7 @@
#define VPX_CODEC_DISABLE_COMPAT 1
#include "vpx/vpx_decoder.h"
#include "vpx/vp8dx.h"
#define interface (&vpx_codec_vp8_dx_algo)
#define interface (vpx_codec_vp8_dx())
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DEC_INCLUDES

View File

@@ -19,7 +19,7 @@
#define VPX_CODEC_DISABLE_COMPAT 1
#include "vpx/vpx_encoder.h"
#include "vpx/vp8cx.h"
#define interface (&vpx_codec_vp8_cx_algo)
#define interface (vpx_codec_vp8_cx())
#define fourcc 0x30385056
@EXTRA_INCLUDES

View File

@@ -2,7 +2,7 @@
#define VPX_CODEC_DISABLE_COMPAT 1
#include "vpx/vpx_encoder.h"
#include "vpx/vp8cx.h"
#define interface (&vpx_codec_vp8_cx_algo)
#define interface (vpx_codec_vp8_cx())
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ENC_INCLUDES

View File

@@ -33,7 +33,7 @@ Initializing The Codec
----------------------
The decoder is initialized by the following code. This is an example for
the VP8 decoder, but the code is analogous for all algorithms. Replace
`&vpx_codec_vp8_dx_algo` with a pointer to the interface exposed by the
`vpx_codec_vp8_dx()` with a pointer to the interface exposed by the
algorithm you want to use. The `cfg` argument is left as NULL in this
example, because we want the algorithm to determine the stream
configuration (width/height) and allocate memory automatically. This

97
libs.mk
View File

@@ -9,7 +9,13 @@
##
ASM:=$(if $(filter yes,$(CONFIG_GCC)),.asm.s,.asm)
# ARM assembly files are written in RVCT-style. We use some make magic to
# filter those files to allow GCC compilation
ifeq ($(ARCH_ARM),yes)
ASM:=$(if $(filter yes,$(CONFIG_GCC)),.asm.s,.asm)
else
ASM:=.asm
endif
CODEC_SRCS-yes += libs.mk
@@ -126,28 +132,22 @@ INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(call enabled,CODEC_EXPORTS)
ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
ifeq ($(CONFIG_MSVS),yes)
ifeq ($(ARCH_ARM),yes)
ifeq ($(HAVE_ARMV5TE),yes)
ARM_ARCH=v5
endif
ifeq ($(HAVE_ARMV6),yes)
ARM_ARCH=v6
endif
obj_int_extract.vcproj: $(SRC_PATH_BARE)/build/make/obj_int_extract.c
@cp $(SRC_PATH_BARE)/build/arm-wince-vs8/obj_int_extract.bat .
@cp $(SRC_PATH_BARE)/build/x86-msvs/obj_int_extract.bat .
@echo " [CREATE] $@"
$(SRC_PATH_BARE)/build/make/gen_msvs_proj.sh\
--exe\
--target=$(TOOLCHAIN)\
$(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
--name=obj_int_extract\
--proj-guid=E1360C65-D375-4335-8057-7ED99CC3F9B2\
--out=$@ $^\
-I".&quot;;&quot;$(SRC_PATH_BARE)"
$(SRC_PATH_BARE)/build/make/gen_msvs_proj.sh \
--exe \
--target=$(TOOLCHAIN) \
--name=obj_int_extract \
--ver=$(CONFIG_VS_VERSION) \
--proj-guid=E1360C65-D375-4335-8057-7ED99CC3F9B2 \
$(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
--out=$@ $^ \
-I. \
-I"$(SRC_PATH_BARE)" \
PROJECTS-$(BUILD_LIBVPX) += obj_int_extract.vcproj
PROJECTS-$(BUILD_LIBVPX) += obj_int_extract.bat
endif
vpx.def: $(call enabled,CODEC_EXPORTS)
@echo " [CREATE] $@"
@@ -158,15 +158,16 @@ CLEAN-OBJS += vpx.def
vpx.vcproj: $(CODEC_SRCS) vpx.def
@echo " [CREATE] $@"
$(SRC_PATH_BARE)/build/make/gen_msvs_proj.sh\
--lib\
--target=$(TOOLCHAIN)\
$(SRC_PATH_BARE)/build/make/gen_msvs_proj.sh \
--lib \
--target=$(TOOLCHAIN) \
$(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
--name=vpx\
--proj-guid=DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74\
--module-def=vpx.def\
--ver=$(CONFIG_VS_VERSION)\
--out=$@ $(CFLAGS) $^\
--name=vpx \
--proj-guid=DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74 \
--module-def=vpx.def \
--ver=$(CONFIG_VS_VERSION) \
--out=$@ $(CFLAGS) $^ \
--src-path-bare="$(SRC_PATH_BARE)" \
PROJECTS-$(BUILD_LIBVPX) += vpx.vcproj
@@ -230,36 +231,38 @@ endif
#
# Add assembler dependencies for configuration and offsets
#
$(filter %.s.o,$(OBJS-yes)): $(BUILD_PFX)vpx_config.asm
$(filter %.asm.o,$(OBJS-yes)): $(BUILD_PFX)vpx_config.asm
$(filter %.s.o,$(OBJS-yes)): $(BUILD_PFX)vpx_config.asm
$(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)vpx_config.asm
#
# Calculate platform- and compiler-specific offsets for hand coded assembly
#
ifeq ($(ARCH_ARM), yes)
asm_com_offsets.asm: obj_int_extract
asm_com_offsets.asm: $(VP8_PREFIX)common/asm_com_offsets.c.o
ifeq ($(CONFIG_EXTERNAL_BUILD),) # Visual Studio uses obj_int_extract.bat
ifeq ($(ARCH_ARM), yes)
asm_com_offsets.asm: obj_int_extract
asm_com_offsets.asm: $(VP8_PREFIX)common/asm_com_offsets.c.o
./obj_int_extract rvds $< $(ADS2GAS) > $@
OBJS-yes += $(VP8_PREFIX)common/asm_com_offsets.c.o
CLEAN-OBJS += asm_com_offsets.asm
$(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)asm_com_offsets.asm
OBJS-yes += $(VP8_PREFIX)common/asm_com_offsets.c.o
CLEAN-OBJS += asm_com_offsets.asm
$(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)asm_com_offsets.asm
ifeq ($(CONFIG_VP8_ENCODER), yes)
asm_enc_offsets.asm: obj_int_extract
asm_enc_offsets.asm: $(VP8_PREFIX)encoder/asm_enc_offsets.c.o
ifeq ($(CONFIG_VP8_ENCODER), yes)
asm_enc_offsets.asm: obj_int_extract
asm_enc_offsets.asm: $(VP8_PREFIX)encoder/asm_enc_offsets.c.o
./obj_int_extract rvds $< $(ADS2GAS) > $@
OBJS-yes += $(VP8_PREFIX)encoder/asm_enc_offsets.c.o
CLEAN-OBJS += asm_enc_offsets.asm
$(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)asm_enc_offsets.asm
endif
OBJS-yes += $(VP8_PREFIX)encoder/asm_enc_offsets.c.o
CLEAN-OBJS += asm_enc_offsets.asm
$(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)asm_enc_offsets.asm
endif
ifeq ($(CONFIG_VP8_DECODER), yes)
asm_dec_offsets.asm: obj_int_extract
asm_dec_offsets.asm: $(VP8_PREFIX)decoder/asm_dec_offsets.c.o
ifeq ($(CONFIG_VP8_DECODER), yes)
asm_dec_offsets.asm: obj_int_extract
asm_dec_offsets.asm: $(VP8_PREFIX)decoder/asm_dec_offsets.c.o
./obj_int_extract rvds $< $(ADS2GAS) > $@
OBJS-yes += $(VP8_PREFIX)decoder/asm_dec_offsets.c.o
CLEAN-OBJS += asm_dec_offsets.asm
$(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)asm_dec_offsets.asm
OBJS-yes += $(VP8_PREFIX)decoder/asm_dec_offsets.c.o
CLEAN-OBJS += asm_dec_offsets.asm
$(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)asm_dec_offsets.asm
endif
endif
endif

View File

@@ -31,7 +31,7 @@
The WebM project is an open source project supported by its community. For
questions about this SDK, please mail the apps-devel@webmproject.org list.
To contribute, see http://www.webmproject.org/code/contribute and mail
vpx-devel@webmproject.org.
codec-devel@webmproject.org.
*/
/*!\page changelog CHANGELOG

View File

@@ -9,38 +9,13 @@
##
ifeq ($(ARCH_ARM),yes)
ARM_DEVELOP=no
ARM_DEVELOP:=$(if $(filter %vpx.vcproj,$(wildcard *.vcproj)),yes)
ifeq ($(ARM_DEVELOP),yes)
vpx.sln:
@echo " [COPY] $@"
@cp $(SRC_PATH_BARE)/build/arm-wince-vs8/vpx.sln .
PROJECTS-yes += vpx.sln
else
vpx.sln: $(wildcard *.vcproj)
@echo " [CREATE] $@"
$(SRC_PATH_BARE)/build/make/gen_msvs_sln.sh \
$(if $(filter %vpx.vcproj,$^),--dep=vpxdec:vpx) \
$(if $(filter %vpx.vcproj,$^),--dep=xma:vpx) \
--ver=$(CONFIG_VS_VERSION)\
--target=$(TOOLCHAIN)\
--out=$@ $^
vpx.sln.mk: vpx.sln
@true
PROJECTS-yes += vpx.sln vpx.sln.mk
-include vpx.sln.mk
endif
else
vpx.sln: $(wildcard *.vcproj)
@echo " [CREATE] $@"
$(SRC_PATH_BARE)/build/make/gen_msvs_sln.sh \
$(if $(filter %vpx.vcproj,$^),\
$(foreach vcp,$(filter-out %vpx.vcproj,$^),\
$(foreach vcp,$(filter-out %vpx.vcproj %obj_int_extract.vcproj,$^),\
--dep=$(vcp:.vcproj=):vpx)) \
--dep=vpx:obj_int_extract \
--ver=$(CONFIG_VS_VERSION)\
--out=$@ $^
vpx.sln.mk: vpx.sln
@@ -48,7 +23,6 @@ vpx.sln.mk: vpx.sln
PROJECTS-yes += vpx.sln vpx.sln.mk
-include vpx.sln.mk
endif
# Always install this file, as it is an unconditional post-build rule.
INSTALL_MAPS += src/% $(SRC_PATH_BARE)/%

View File

@@ -25,7 +25,7 @@
codec may write into to store details about a single instance of that codec.
Most of the context is implementation specific, and thus opaque to the
application. The context structure as seen by the application is of fixed
size, and thus can be allocated eith with automatic storage or dynamically
size, and thus can be allocated with automatic storage or dynamically
on the heap.
Most operations require an initialized codec context. Codec context
@@ -74,7 +74,7 @@
the ABI is versioned. The ABI version number must be passed at
initialization time to ensure the application is using a header file that
matches the library. The current ABI version number is stored in the
prepropcessor macros #VPX_CODEC_ABI_VERSION, #VPX_ENCODER_ABI_VERSION, and
preprocessor macros #VPX_CODEC_ABI_VERSION, #VPX_ENCODER_ABI_VERSION, and
#VPX_DECODER_ABI_VERSION. For convenience, each initialization function has
a wrapper macro that inserts the correct version number. These macros are
named like the initialization methods, but without the _ver suffix.
@@ -125,7 +125,7 @@
The special value <code>0</code> is reserved to represent an infinite
deadline. In this case, the codec will perform as much processing as
possible to yeild the highest quality frame.
possible to yield the highest quality frame.
By convention, the value <code>1</code> is used to mean "return as fast as
possible."
@@ -135,7 +135,7 @@
/*! \page usage_xma External Memory Allocation
Applications that wish to have fine grained control over how and where
decoders allocate memory \ref MAY make use of the e_xternal Memory Allocation
decoders allocate memory \ref MAY make use of the eXternal Memory Allocation
(XMA) interface. Not all codecs support the XMA \ref usage_features.
To use a decoder in XMA mode, the decoder \ref MUST be initialized with the
@@ -143,7 +143,7 @@
allocate is heavily dependent on the size of the encoded video frames. The
size of the video must be known before requesting the decoder's memory map.
This stream information can be obtained with the vpx_codec_peek_stream_info()
function, which does not require a contructed decoder context. If the exact
function, which does not require a constructed decoder context. If the exact
stream is not known, a stream info structure can be created that reflects
the maximum size that the decoder instance is required to support.
@@ -175,7 +175,7 @@
\section usage_xma_seg_szalign Segment Size and Alignment
The sz (size) and align (alignment) parameters describe the required size
and alignment of the requested segment. Alignment will always be a power of
two. Applications \ref MUST honor the aligment requested. Failure to do so
two. Applications \ref MUST honor the alignment requested. Failure to do so
could result in program crashes or may incur a speed penalty.
\section usage_xma_seg_flags Segment Flags

View File

@@ -16,12 +16,11 @@
#include "findnearmv.h"
#include "entropymode.h"
#include "systemdependent.h"
#include "vpxerrors.h"
extern void vp8_init_scan_order_mask();
void vp8_update_mode_info_border(MODE_INFO *mi, int rows, int cols)
static void update_mode_info_border(MODE_INFO *mi, int rows, int cols)
{
int i;
vpx_memset(mi - cols - 2, 0, sizeof(MODE_INFO) * (cols + 1));
@@ -71,7 +70,7 @@ int vp8_alloc_frame_buffers(VP8_COMMON *oci, int width, int height)
if (vp8_yv12_alloc_frame_buffer(&oci->yv12_fb[i], width, height, VP8BORDERINPIXELS) < 0)
{
vp8_de_alloc_frame_buffers(oci);
return ALLOC_FAILURE;
return 1;
}
}
@@ -88,13 +87,13 @@ int vp8_alloc_frame_buffers(VP8_COMMON *oci, int width, int height)
if (vp8_yv12_alloc_frame_buffer(&oci->temp_scale_frame, width, 16, VP8BORDERINPIXELS) < 0)
{
vp8_de_alloc_frame_buffers(oci);
return ALLOC_FAILURE;
return 1;
}
if (vp8_yv12_alloc_frame_buffer(&oci->post_proc_buffer, width, height, VP8BORDERINPIXELS) < 0)
{
vp8_de_alloc_frame_buffers(oci);
return ALLOC_FAILURE;
return 1;
}
oci->mb_rows = height >> 4;
@@ -106,7 +105,7 @@ int vp8_alloc_frame_buffers(VP8_COMMON *oci, int width, int height)
if (!oci->mip)
{
vp8_de_alloc_frame_buffers(oci);
return ALLOC_FAILURE;
return 1;
}
oci->mi = oci->mip + oci->mode_info_stride + 1;
@@ -117,10 +116,10 @@ int vp8_alloc_frame_buffers(VP8_COMMON *oci, int width, int height)
if (!oci->above_context)
{
vp8_de_alloc_frame_buffers(oci);
return ALLOC_FAILURE;
return 1;
}
vp8_update_mode_info_border(oci->mi, oci->mb_rows, oci->mb_cols);
update_mode_info_border(oci->mi, oci->mb_rows, oci->mb_cols);
return 0;
}

View File

@@ -11,21 +11,13 @@
#include "vpx_ports/config.h"
#include "vpx_ports/arm.h"
#include "g_common.h"
#include "pragmas.h"
#include "subpixel.h"
#include "loopfilter.h"
#include "recon.h"
#include "idct.h"
#include "onyxc_int.h"
extern void (*vp8_build_intra_predictors_mby_ptr)(MACROBLOCKD *x);
extern void vp8_build_intra_predictors_mby(MACROBLOCKD *x);
extern void vp8_build_intra_predictors_mby_neon(MACROBLOCKD *x);
extern void (*vp8_build_intra_predictors_mby_s_ptr)(MACROBLOCKD *x);
extern void vp8_build_intra_predictors_mby_s(MACROBLOCKD *x);
extern void vp8_build_intra_predictors_mby_s_neon(MACROBLOCKD *x);
#include "vp8/common/g_common.h"
#include "vp8/common/pragmas.h"
#include "vp8/common/subpixel.h"
#include "vp8/common/loopfilter.h"
#include "vp8/common/recon.h"
#include "vp8/common/idct.h"
#include "vp8/common/onyxc_int.h"
void vp8_arch_arm_common_init(VP8_COMMON *ctx)
{
@@ -106,31 +98,12 @@ void vp8_arch_arm_common_init(VP8_COMMON *ctx)
rtcd->recon.recon2 = vp8_recon2b_neon;
rtcd->recon.recon4 = vp8_recon4b_neon;
rtcd->recon.recon_mb = vp8_recon_mb_neon;
rtcd->recon.build_intra_predictors_mby =
vp8_build_intra_predictors_mby_neon;
rtcd->recon.build_intra_predictors_mby_s =
vp8_build_intra_predictors_mby_s_neon;
}
#endif
#endif
#if HAVE_ARMV6
#if CONFIG_RUNTIME_CPU_DETECT
if (has_media)
#endif
{
vp8_build_intra_predictors_mby_ptr = vp8_build_intra_predictors_mby;
vp8_build_intra_predictors_mby_s_ptr = vp8_build_intra_predictors_mby_s;
}
#endif
#if HAVE_ARMV7
#if CONFIG_RUNTIME_CPU_DETECT
if (has_neon)
#endif
{
vp8_build_intra_predictors_mby_ptr =
vp8_build_intra_predictors_mby_neon;
vp8_build_intra_predictors_mby_s_ptr =
vp8_build_intra_predictors_mby_s_neon;
}
#endif
}

View File

@@ -10,9 +10,9 @@
#include <math.h>
#include "filter.h"
#include "subpixel.h"
#include "arm/bilinearfilter_arm.h"
#include "vp8/common/filter.h"
#include "vp8/common/subpixel.h"
#include "bilinearfilter_arm.h"
void vp8_filter_block2d_bil_armv6
(

View File

@@ -11,8 +11,8 @@
#include "vpx_ports/config.h"
#include <math.h>
#include "filter.h"
#include "subpixel.h"
#include "vp8/common/filter.h"
#include "vp8/common/subpixel.h"
#include "vpx_ports/mem.h"
extern void vp8_filter_block2d_first_pass_armv6

View File

@@ -11,8 +11,8 @@
#include "vpx_ports/config.h"
#include <math.h>
#include "loopfilter.h"
#include "onyxc_int.h"
#include "vp8/common/loopfilter.h"
#include "vp8/common/onyxc_int.h"
extern prototype_loopfilter(vp8_loop_filter_horizontal_edge_armv6);
extern prototype_loopfilter(vp8_loop_filter_vertical_edge_armv6);

View File

@@ -10,8 +10,8 @@
#include "vpx_ports/config.h"
#include "recon.h"
#include "blockd.h"
#include "vp8/common/recon.h"
#include "vp8/common/blockd.h"
extern void vp8_recon16x16mb_neon(unsigned char *pred_ptr, short *diff_ptr, unsigned char *dst_ptr, int ystride, unsigned char *udst_ptr, unsigned char *vdst_ptr);

View File

@@ -53,6 +53,9 @@ extern prototype_copy_block(vp8_copy_mem16x16_neon);
extern prototype_recon_macroblock(vp8_recon_mb_neon);
extern prototype_build_intra_predictors(vp8_build_intra_predictors_mby_neon);
extern prototype_build_intra_predictors(vp8_build_intra_predictors_mby_s_neon);
#if !CONFIG_RUNTIME_CPU_DETECT
#undef vp8_recon_recon
#define vp8_recon_recon vp8_recon_b_neon
@@ -74,6 +77,13 @@ extern prototype_recon_macroblock(vp8_recon_mb_neon);
#undef vp8_recon_recon_mb
#define vp8_recon_recon_mb vp8_recon_mb_neon
#undef vp8_recon_build_intra_predictors_mby
#define vp8_recon_build_intra_predictors_mby vp8_build_intra_predictors_mby_neon
#undef vp8_recon_build_intra_predictors_mby_s
#define vp8_recon_build_intra_predictors_mby_s vp8_build_intra_predictors_mby_s_neon
#endif
#endif

View File

@@ -10,10 +10,10 @@
#include "vpx_ports/config.h"
#include "blockd.h"
#include "reconintra.h"
#include "vp8/common/blockd.h"
#include "vp8/common/reconintra.h"
#include "vpx_mem/vpx_mem.h"
#include "recon.h"
#include "vp8/common/recon.h"
#if HAVE_ARMV7
extern void vp8_build_intra_predictors_mby_neon_func(

View File

@@ -12,8 +12,6 @@
#include "blockd.h"
#include "vpx_mem/vpx_mem.h"
const int vp8_block2type[25] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 1};
const unsigned char vp8_block2left[25] =
{
0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8

View File

@@ -28,11 +28,6 @@ void vpx_log(const char *format, ...);
#define DCPREDSIMTHRESH 0
#define DCPREDCNTTHRESH 3
#define Y1CONTEXT 0
#define UCONTEXT 1
#define VCONTEXT 2
#define Y2CONTEXT 3
#define MB_FEATURE_TREE_PROBS 3
#define MAX_MB_SEGMENTS 4
@@ -48,6 +43,11 @@ typedef struct
int r, c;
} POS;
#define PLANE_TYPE_Y_NO_DC 0
#define PLANE_TYPE_Y2 1
#define PLANE_TYPE_UV 2
#define PLANE_TYPE_Y_WITH_DC 3
typedef char ENTROPY_CONTEXT;
typedef struct
@@ -58,8 +58,6 @@ typedef struct
ENTROPY_CONTEXT y2;
} ENTROPY_CONTEXT_PLANES;
extern const int vp8_block2type[25];
extern const unsigned char vp8_block2left[25];
extern const unsigned char vp8_block2above[25];

View File

@@ -1,570 +0,0 @@
/*
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef bool_coder_h
#define bool_coder_h 1
/* Arithmetic bool coder with largish probability range.
Timothy S Murphy 6 August 2004 */
/* So as not to force users to drag in too much of my idiosyncratic C++ world,
I avoid fancy storage management. */
#include <assert.h>
#include <stddef.h>
#include <stdio.h>
typedef unsigned char vp8bc_index_t; // probability index
/* There are a couple of slight variants in the details of finite-precision
arithmetic coding. May be safely ignored by most users. */
enum vp8bc_rounding
{
vp8bc_down = 0, // just like VP8
vp8bc_down_full = 1, // handles minimum probability correctly
vp8bc_up = 2
};
#if _MSC_VER
/* Note that msvc by default does not inline _anything_ (regardless of the
setting of inline_depth) and that a command-line option (-Ob1 or -Ob2)
is required to inline even the smallest functions. */
# pragma inline_depth( 255) // I mean it when I inline something
# pragma warning( disable : 4099) // No class vs. struct harassment
# pragma warning( disable : 4250) // dominance complaints
# pragma warning( disable : 4284) // operator-> in templates
# pragma warning( disable : 4800) // bool conversion
// don't let prefix ++,-- stand in for postfix, disaster would ensue
# pragma warning( error : 4620 4621)
#endif // _MSC_VER
#if __cplusplus
// Sometimes one wishes to be definite about integer lengths.
struct int_types
{
typedef const bool cbool;
typedef const signed char cchar;
typedef const short cshort;
typedef const int cint;
typedef const int clong;
typedef const double cdouble;
typedef const size_t csize_t;
typedef unsigned char uchar; // 8 bits
typedef const uchar cuchar;
typedef short int16;
typedef unsigned short uint16;
typedef const int16 cint16;
typedef const uint16 cuint16;
typedef int int32;
typedef unsigned int uint32;
typedef const int32 cint32;
typedef const uint32 cuint32;
typedef unsigned int uint;
typedef unsigned int ulong;
typedef const uint cuint;
typedef const ulong culong;
// All structs consume space, may as well have a vptr.
virtual ~int_types();
};
struct bool_coder_spec;
struct bool_coder;
struct bool_writer;
struct bool_reader;
struct bool_coder_namespace : int_types
{
typedef vp8bc_index_t Index;
typedef bool_coder_spec Spec;
typedef const Spec c_spec;
enum Rounding
{
Down = vp8bc_down,
down_full = vp8bc_down_full,
Up = vp8bc_up
};
};
// Archivable specification of a bool coder includes rounding spec
// and probability mapping table. The latter replaces a uchar j
// (0 <= j < 256) with an arbitrary uint16 tbl[j] = p.
// p/65536 is then the probability of a zero.
struct bool_coder_spec : bool_coder_namespace
{
friend struct bool_coder;
friend struct bool_writer;
friend struct bool_reader;
friend struct bool_coder_spec_float;
friend struct bool_coder_spec_explicit_table;
friend struct bool_coder_spec_exponential_table;
friend struct BPsrc;
private:
uint w; // precision
Rounding r;
uint ebits, mbits, ebias;
uint32 mmask;
Index max_index, half_index;
uint32 mantissa(Index i) const
{
assert(i < half_index);
return (1 << mbits) + (i & mmask);
}
uint exponent(Index i) const
{
assert(i < half_index);
return ebias - (i >> mbits);
}
uint16 Ptbl[256]; // kinda clunky, but so is storage management.
/* Cost in bits of encoding a zero at every probability, scaled by 2^20.
Assumes that index is at most 8 bits wide. */
uint32 Ctbl[256];
uint32 split(Index i, uint32 R) const // 1 <= split <= max( 1, R-1)
{
if (!ebias)
return 1 + (((R - 1) * Ptbl[i]) >> 16);
if (i >= half_index)
return R - split(max_index - i, R);
return 1 + (((R - 1) * mantissa(i)) >> exponent(i));
}
uint32 max_range() const
{
return (1 << w) - (r == down_full ? 0 : 1);
}
uint32 min_range() const
{
return (1 << (w - 1)) + (r == down_full ? 1 : 0);
}
uint32 Rinc() const
{
return r == Up ? 1 : 0;
}
void check_prec() const;
bool float_init(uint Ebits, uint Mbits);
void cost_init();
bool_coder_spec(
uint prec, Rounding rr, uint Ebits = 0, uint Mbits = 0
)
: w(prec), r(rr)
{
float_init(Ebits, Mbits);
}
public:
// Read complete spec from file.
bool_coder_spec(FILE *);
// Write spec to file.
void dump(FILE *) const;
// return probability index best approximating prob.
Index operator()(double prob) const;
// probability corresponding to index
double operator()(Index i) const;
Index complement(Index i) const
{
return max_index - i;
}
Index max_index() const
{
return max_index;
}
Index half_index() const
{
return half_index;
}
uint32 cost_zero(Index i) const
{
return Ctbl[i];
}
uint32 cost_one(Index i) const
{
return Ctbl[ max_index - i];
}
uint32 cost_bit(Index i, bool b) const
{
return Ctbl[b? max_index-i:i];
}
};
/* Pseudo floating-point probability specification.
At least one of Ebits and Mbits must be nonzero.
Since all arithmetic is done at 32 bits, Ebits is at most 5.
Total significant bits in index is Ebits + Mbits + 1.
Below the halfway point (i.e. when the top significant bit is 0),
the index is (e << Mbits) + m.
The exponent e is between 0 and (2**Ebits) - 1,
the mantissa m is between 0 and (2**Mbits) - 1.
Prepending an implicit 1 to the mantissa, the probability is then
(2**Mbits + m) >> (e - 2**Ebits - 1 - Mbits),
which has (1/2)**(2**Ebits + 1) as a minimum
and (1/2) * [1 - 2**(Mbits + 1)] as a maximum.
When the index is above the halfway point, the probability is the
complement of the probability associated to the complement of the index.
Note that the probability increases with the index and that, because of
the symmetry, we cannot encode probability exactly 1/2; though we
can get as close to 1/2 as we like, provided we have enough Mbits.
The latter is of course not a problem in practice, one never has
exact probabilities and entropy errors are second order, that is, the
"overcoding" of a zero will be largely compensated for by the
"undercoding" of a one (or vice-versa).
Compared to arithmetic probability specs (a la VP8), this will do better
at very high and low probabilities and worse at probabilities near 1/2,
as well as facilitating the usage of wider or narrower probability indices.
*/
struct bool_coder_spec_float : bool_coder_spec
{
bool_coder_spec_float(
uint Ebits = 3, uint Mbits = 4, Rounding rr = down_full, uint prec = 12
)
: bool_coder_spec(prec, rr, Ebits, Mbits)
{
cost_init();
}
};
struct bool_coder_spec_explicit_table : bool_coder_spec
{
bool_coder_spec_explicit_table(
cuint16 probability_table[256] = 0, // default is tbl[i] = i << 8.
Rounding = down_full,
uint precision = 16
);
};
// Contruct table via multiplicative interpolation between
// p[128] = 1/2 and p[0] = (1/2)^x.
// Since we are working with 16-bit precision, x is at most 16.
// For probabilities to increase with i, we must have x > 1.
// For 0 <= i <= 128, p[i] = (1/2)^{ 1 + [1 - (i/128)]*[x-1] }.
// Finally, p[128+i] = 1 - p[128 - i].
struct bool_coder_spec_exponential_table : bool_coder_spec
{
bool_coder_spec_exponential_table(uint x, Rounding = down_full, uint prec = 16);
};
// Commonalities between writer and reader.
struct bool_coder : bool_coder_namespace
{
friend struct bool_writer;
friend struct bool_reader;
friend struct BPsrc;
private:
uint32 Low, Range;
cuint32 min_range;
cuint32 rinc;
c_spec spec;
void _reset()
{
Low = 0;
Range = spec.max_range();
}
bool_coder(c_spec &s)
: min_range(s.min_range()),
rinc(s.Rinc()),
spec(s)
{
_reset();
}
uint32 half() const
{
return 1 + ((Range - 1) >> 1);
}
public:
c_spec &Spec() const
{
return spec;
}
};
struct bool_writer : bool_coder
{
friend struct BPsrc;
private:
uchar *Bstart, *Bend, *B;
int bit_lag;
bool is_toast;
void carry();
void reset()
{
_reset();
bit_lag = 32 - spec.w;
is_toast = 0;
}
void raw(bool value, uint32 split);
public:
bool_writer(c_spec &, uchar *Dest, size_t Len);
virtual ~bool_writer();
void operator()(Index p, bool v)
{
raw(v, spec.split(p, Range));
}
uchar *buf() const
{
return Bstart;
}
size_t bytes_written() const
{
return B - Bstart;
}
// Call when done with input, flushes internal state.
// DO NOT write any more data after calling this.
bool_writer &flush();
void write_bits(int n, uint val)
{
if (n)
{
uint m = 1 << (n - 1);
do
{
raw((bool)(val & m), half());
}
while (m >>= 1);
}
}
# if 0
// We are agnostic about storage management.
// By default, overflows throw an assert but user can
// override to provide an expanding buffer using ...
virtual void overflow(uint Len) const;
// ... this function copies already-written data into new buffer
// and retains new buffer location.
void new_buffer(uchar *dest, uint Len);
// Note that storage management is the user's responsibility.
# endif
};
// This could be adjusted to use a little less lookahead.
struct bool_reader : bool_coder
{
friend struct BPsrc;
private:
cuchar *const Bstart; // for debugging
cuchar *B;
cuchar *const Bend;
cuint shf;
uint bct;
bool raw(uint32 split);
public:
bool_reader(c_spec &s, cuchar *src, size_t Len);
bool operator()(Index p)
{
return raw(spec.split(p, Range));
}
uint read_bits(int num_bits)
{
uint v = 0;
while (--num_bits >= 0)
v += v + (raw(half()) ? 1 : 0);
return v;
}
};
extern "C" {
#endif /* __cplusplus */
/* C interface */
typedef struct bool_coder_spec bool_coder_spec;
typedef struct bool_writer bool_writer;
typedef struct bool_reader bool_reader;
typedef const bool_coder_spec c_bool_coder_spec;
typedef const bool_writer c_bool_writer;
typedef const bool_reader c_bool_reader;
/* Optionally override default precision when constructing coder_specs.
Just pass a zero pointer if you don't care.
Precision is at most 16 bits for table specs, at most 23 otherwise. */
struct vp8bc_prec
{
enum vp8bc_rounding r; /* see top header file for def */
unsigned int prec; /* range precision in bits */
};
typedef const struct vp8bc_prec vp8bc_c_prec;
/* bool_coder_spec contains mapping of uchars to actual probabilities
(16 bit uints) as well as (usually immaterial) selection of
exact finite-precision algorithm used (for now, the latter can only
be overridden using the C++ interface).
See comments above the corresponding C++ constructors for discussion,
especially of exponential probability table generation. */
bool_coder_spec *vp8bc_vp8spec(); // just like vp8
bool_coder_spec *vp8bc_literal_spec(
const unsigned short prob_map[256], // 0 is like vp8 w/more precision
vp8bc_c_prec*
);
bool_coder_spec *vp8bc_float_spec(
unsigned int exponent_bits, unsigned int mantissa_bits, vp8bc_c_prec*
);
bool_coder_spec *vp8bc_exponential_spec(unsigned int min_exp, vp8bc_c_prec *);
bool_coder_spec *vp8bc_spec_from_file(FILE *);
void vp8bc_destroy_spec(c_bool_coder_spec *);
void vp8bc_spec_to_file(c_bool_coder_spec *, FILE *);
/* Nearest index to supplied probability of zero, 0 <= prob <= 1. */
vp8bc_index_t vp8bc_index(c_bool_coder_spec *, double prob);
vp8bc_index_t vp8bc_index_from_counts(
c_bool_coder_spec *p, unsigned int zero_ct, unsigned int one_ct
);
/* In case you want to look */
double vp8bc_probability(c_bool_coder_spec *, vp8bc_index_t);
/* Opposite index */
vp8bc_index_t vp8bc_complement(c_bool_coder_spec *, vp8bc_index_t);
/* Cost in bits of encoding a zero at given probability, scaled by 2^20.
(assumes that an int holds at least 32 bits). */
unsigned int vp8bc_cost_zero(c_bool_coder_spec *, vp8bc_index_t);
unsigned int vp8bc_cost_one(c_bool_coder_spec *, vp8bc_index_t);
unsigned int vp8bc_cost_bit(c_bool_coder_spec *, vp8bc_index_t, int);
/* bool_writer interface */
/* Length = 0 disables checking for writes beyond buffer end. */
bool_writer *vp8bc_create_writer(
c_bool_coder_spec *, unsigned char *Destination, size_t Length
);
/* Flushes out any buffered data and returns total # of bytes written. */
size_t vp8bc_destroy_writer(bool_writer *);
void vp8bc_write_bool(bool_writer *, int boolean_val, vp8bc_index_t false_prob);
void vp8bc_write_bits(
bool_writer *, unsigned int integer_value, int number_of_bits
);
c_bool_coder_spec *vp8bc_writer_spec(c_bool_writer *);
/* bool_reader interface */
/* Length = 0 disables checking for reads beyond buffer end. */
bool_reader *vp8bc_create_reader(
c_bool_coder_spec *, const unsigned char *Source, size_t Length
);
void vp8bc_destroy_reader(bool_reader *);
int vp8bc_read_bool(bool_reader *, vp8bc_index_t false_prob);
unsigned int vp8bc_read_bits(bool_reader *, int number_of_bits);
c_bool_coder_spec *vp8bc_reader_spec(c_bool_reader *);
#if __cplusplus
}
#endif
#endif /* bool_coder_h */

View File

@@ -1,93 +0,0 @@
/*
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef CODEC_COMMON_INTERFACE_H
#define CODEC_COMMON_INTERFACE_H
#define __export
#define _export
#define dll_export __declspec( dllexport )
#define dll_import __declspec( dllimport )
// Playback ERROR Codes.
#define NO_DECODER_ERROR 0
#define REMOTE_DECODER_ERROR -1
#define DFR_BAD_DCT_COEFF -100
#define DFR_ZERO_LENGTH_FRAME -101
#define DFR_FRAME_SIZE_INVALID -102
#define DFR_OUTPUT_BUFFER_OVERFLOW -103
#define DFR_INVALID_FRAME_HEADER -104
#define FR_INVALID_MODE_TOKEN -110
#define ETR_ALLOCATION_ERROR -200
#define ETR_INVALID_ROOT_PTR -201
#define SYNCH_ERROR -400
#define BUFFER_UNDERFLOW_ERROR -500
#define PB_IB_OVERFLOW_ERROR -501
// External error triggers
#define PB_HEADER_CHECKSUM_ERROR -601
#define PB_DATA_CHECKSUM_ERROR -602
// DCT Error Codes
#define DDCT_EXPANSION_ERROR -700
#define DDCT_INVALID_TOKEN_ERROR -701
// exception_errors
#define GEN_EXCEPTIONS -800
#define EX_UNQUAL_ERROR -801
// Unrecoverable error codes
#define FATAL_PLAYBACK_ERROR -1000
#define GEN_ERROR_CREATING_CDC -1001
#define GEN_THREAD_CREATION_ERROR -1002
#define DFR_CREATE_BMP_FAILED -1003
// YUV buffer configuration structure
typedef struct
{
int y_width;
int y_height;
int y_stride;
int uv_width;
int uv_height;
int uv_stride;
unsigned char *y_buffer;
unsigned char *u_buffer;
unsigned char *v_buffer;
} YUV_BUFFER_CONFIG;
typedef enum
{
C_SET_KEY_FRAME,
C_SET_FIXED_Q,
C_SET_FIRSTPASS_FILE,
C_SET_EXPERIMENTAL_MIN,
C_SET_EXPERIMENTAL_MAX = C_SET_EXPERIMENTAL_MIN + 255,
C_SET_CHECKPROTECT,
C_SET_TESTMODE,
C_SET_INTERNAL_SIZE,
C_SET_RECOVERY_FRAME,
C_SET_REFERENCEFRAME,
C_SET_GOLDENFRAME
#ifndef VP50_COMP_INTERFACE
// Specialist test facilities.
// C_VCAP_PARAMS, // DO NOT USE FOR NOW WITH VFW CODEC
#endif
} C_SETTING;
typedef unsigned long C_SET_VALUE;
#endif

View File

@@ -38,7 +38,7 @@ DECLARE_ALIGNED(16, const short, vp8_sub_pel_filters[8][6]) =
{ 0, -1, 12, 123, -6, 0 },
};
void vp8_filter_block2d_first_pass
static void filter_block2d_first_pass
(
unsigned char *src_ptr,
int *output_ptr,
@@ -82,7 +82,7 @@ void vp8_filter_block2d_first_pass
}
}
void vp8_filter_block2d_second_pass
static void filter_block2d_second_pass
(
int *src_ptr,
unsigned char *output_ptr,
@@ -129,7 +129,7 @@ void vp8_filter_block2d_second_pass
}
void vp8_filter_block2d
static void filter_block2d
(
unsigned char *src_ptr,
unsigned char *output_ptr,
@@ -142,39 +142,13 @@ void vp8_filter_block2d
int FData[9*4]; /* Temp data buffer used in filtering */
/* First filter 1-D horizontally... */
vp8_filter_block2d_first_pass(src_ptr - (2 * src_pixels_per_line), FData, src_pixels_per_line, 1, 9, 4, HFilter);
filter_block2d_first_pass(src_ptr - (2 * src_pixels_per_line), FData, src_pixels_per_line, 1, 9, 4, HFilter);
/* then filter verticaly... */
vp8_filter_block2d_second_pass(FData + 8, output_ptr, output_pitch, 4, 4, 4, 4, VFilter);
filter_block2d_second_pass(FData + 8, output_ptr, output_pitch, 4, 4, 4, 4, VFilter);
}
void vp8_block_variation_c
(
unsigned char *src_ptr,
int src_pixels_per_line,
int *HVar,
int *VVar
)
{
int i, j;
unsigned char *Ptr = src_ptr;
for (i = 0; i < 4; i++)
{
for (j = 0; j < 4; j++)
{
*HVar += abs((int)Ptr[j] - (int)Ptr[j+1]);
*VVar += abs((int)Ptr[j] - (int)Ptr[j+src_pixels_per_line]);
}
Ptr += src_pixels_per_line;
}
}
void vp8_sixtap_predict_c
(
unsigned char *src_ptr,
@@ -191,7 +165,7 @@ void vp8_sixtap_predict_c
HFilter = vp8_sub_pel_filters[xoffset]; /* 6 tap */
VFilter = vp8_sub_pel_filters[yoffset]; /* 6 tap */
vp8_filter_block2d(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter);
filter_block2d(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter);
}
void vp8_sixtap_predict8x8_c
(
@@ -211,11 +185,11 @@ void vp8_sixtap_predict8x8_c
VFilter = vp8_sub_pel_filters[yoffset]; /* 6 tap */
/* First filter 1-D horizontally... */
vp8_filter_block2d_first_pass(src_ptr - (2 * src_pixels_per_line), FData, src_pixels_per_line, 1, 13, 8, HFilter);
filter_block2d_first_pass(src_ptr - (2 * src_pixels_per_line), FData, src_pixels_per_line, 1, 13, 8, HFilter);
/* then filter verticaly... */
vp8_filter_block2d_second_pass(FData + 16, dst_ptr, dst_pitch, 8, 8, 8, 8, VFilter);
filter_block2d_second_pass(FData + 16, dst_ptr, dst_pitch, 8, 8, 8, 8, VFilter);
}
@@ -237,11 +211,11 @@ void vp8_sixtap_predict8x4_c
VFilter = vp8_sub_pel_filters[yoffset]; /* 6 tap */
/* First filter 1-D horizontally... */
vp8_filter_block2d_first_pass(src_ptr - (2 * src_pixels_per_line), FData, src_pixels_per_line, 1, 9, 8, HFilter);
filter_block2d_first_pass(src_ptr - (2 * src_pixels_per_line), FData, src_pixels_per_line, 1, 9, 8, HFilter);
/* then filter verticaly... */
vp8_filter_block2d_second_pass(FData + 16, dst_ptr, dst_pitch, 8, 8, 4, 8, VFilter);
filter_block2d_second_pass(FData + 16, dst_ptr, dst_pitch, 8, 8, 4, 8, VFilter);
}
@@ -264,10 +238,10 @@ void vp8_sixtap_predict16x16_c
VFilter = vp8_sub_pel_filters[yoffset]; /* 6 tap */
/* First filter 1-D horizontally... */
vp8_filter_block2d_first_pass(src_ptr - (2 * src_pixels_per_line), FData, src_pixels_per_line, 1, 21, 16, HFilter);
filter_block2d_first_pass(src_ptr - (2 * src_pixels_per_line), FData, src_pixels_per_line, 1, 21, 16, HFilter);
/* then filter verticaly... */
vp8_filter_block2d_second_pass(FData + 32, dst_ptr, dst_pitch, 16, 16, 16, 16, VFilter);
filter_block2d_second_pass(FData + 32, dst_ptr, dst_pitch, 16, 16, 16, 16, VFilter);
}
@@ -294,7 +268,7 @@ void vp8_sixtap_predict16x16_c
* Two filter taps should sum to VP8_FILTER_WEIGHT.
*
****************************************************************************/
void vp8_filter_block2d_bil_first_pass
static void filter_block2d_bil_first_pass
(
unsigned char *src_ptr,
unsigned short *dst_ptr,
@@ -345,7 +319,7 @@ void vp8_filter_block2d_bil_first_pass
* Two filter taps should sum to VP8_FILTER_WEIGHT.
*
****************************************************************************/
void vp8_filter_block2d_bil_second_pass
static void filter_block2d_bil_second_pass
(
unsigned short *src_ptr,
unsigned char *dst_ptr,
@@ -399,7 +373,7 @@ void vp8_filter_block2d_bil_second_pass
* SPECIAL NOTES : The largest block size can be handled here is 16x16
*
****************************************************************************/
void vp8_filter_block2d_bil
static void filter_block2d_bil
(
unsigned char *src_ptr,
unsigned char *dst_ptr,
@@ -415,10 +389,10 @@ void vp8_filter_block2d_bil
unsigned short FData[17*16]; /* Temp data buffer used in filtering */
/* First filter 1-D horizontally... */
vp8_filter_block2d_bil_first_pass(src_ptr, FData, src_pitch, Height + 1, Width, HFilter);
filter_block2d_bil_first_pass(src_ptr, FData, src_pitch, Height + 1, Width, HFilter);
/* then 1-D vertically... */
vp8_filter_block2d_bil_second_pass(FData, dst_ptr, dst_pitch, Height, Width, VFilter);
filter_block2d_bil_second_pass(FData, dst_ptr, dst_pitch, Height, Width, VFilter);
}
@@ -444,19 +418,19 @@ void vp8_bilinear_predict4x4_c
unsigned char temp2[16];
bilinear_predict4x4_mmx(src_ptr, src_pixels_per_line, xoffset, yoffset, temp1, 4);
vp8_filter_block2d_bil(src_ptr, temp2, src_pixels_per_line, 4, HFilter, VFilter, 4, 4);
filter_block2d_bil(src_ptr, temp2, src_pixels_per_line, 4, HFilter, VFilter, 4, 4);
for (i = 0; i < 16; i++)
{
if (temp1[i] != temp2[i])
{
bilinear_predict4x4_mmx(src_ptr, src_pixels_per_line, xoffset, yoffset, temp1, 4);
vp8_filter_block2d_bil(src_ptr, temp2, src_pixels_per_line, 4, HFilter, VFilter, 4, 4);
filter_block2d_bil(src_ptr, temp2, src_pixels_per_line, 4, HFilter, VFilter, 4, 4);
}
}
}
#endif
vp8_filter_block2d_bil(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 4, 4);
filter_block2d_bil(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 4, 4);
}
@@ -476,7 +450,7 @@ void vp8_bilinear_predict8x8_c
HFilter = vp8_bilinear_filters[xoffset];
VFilter = vp8_bilinear_filters[yoffset];
vp8_filter_block2d_bil(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 8, 8);
filter_block2d_bil(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 8, 8);
}
@@ -496,7 +470,7 @@ void vp8_bilinear_predict8x4_c
HFilter = vp8_bilinear_filters[xoffset];
VFilter = vp8_bilinear_filters[yoffset];
vp8_filter_block2d_bil(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 8, 4);
filter_block2d_bil(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 8, 4);
}
@@ -516,5 +490,5 @@ void vp8_bilinear_predict16x16_c
HFilter = vp8_bilinear_filters[xoffset];
VFilter = vp8_bilinear_filters[yoffset];
vp8_filter_block2d_bil(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 16, 16);
filter_block2d_bil(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 16, 16);
}

View File

@@ -11,6 +11,13 @@
#include "findnearmv.h"
const unsigned char vp8_mbsplit_offset[4][16] = {
{ 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 2, 8, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}
};
/* Predict motion vectors using those from already-decoded nearby blocks.
Note that we only consider one 4x4 subblock from each candidate 16x16
macroblock. */

View File

@@ -70,4 +70,6 @@ const B_MODE_INFO *vp8_left_bmi(const MODE_INFO *cur_mb, int b);
const B_MODE_INFO *vp8_above_bmi(const MODE_INFO *cur_mb, int b, int mi_stride);
extern const unsigned char vp8_mbsplit_offset[4][16];
#endif

View File

@@ -1,121 +0,0 @@
/*
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef FOURCC_HPP
#define FOURCC_HPP
#include <iosfwd>
#include <cstring>
#if defined(__POWERPC__) || defined(__APPLE__) || defined(__MERKS__)
using namespace std;
#endif
class four_cc
{
public:
four_cc();
four_cc(const char*);
explicit four_cc(unsigned long);
bool operator==(const four_cc&) const;
bool operator!=(const four_cc&) const;
bool operator==(const char*) const;
bool operator!=(const char*) const;
operator unsigned long() const;
unsigned long as_long() const;
four_cc& operator=(unsigned long);
char operator[](int) const;
std::ostream& put(std::ostream&) const;
bool printable() const;
private:
union
{
char code[4];
unsigned long code_as_long;
};
};
inline four_cc::four_cc()
{
}
inline four_cc::four_cc(unsigned long x)
: code_as_long(x)
{
}
inline four_cc::four_cc(const char* str)
{
memcpy(code, str, 4);
}
inline bool four_cc::operator==(const four_cc& rhs) const
{
return code_as_long == rhs.code_as_long;
}
inline bool four_cc::operator!=(const four_cc& rhs) const
{
return !operator==(rhs);
}
inline bool four_cc::operator==(const char* rhs) const
{
return (memcmp(code, rhs, 4) == 0);
}
inline bool four_cc::operator!=(const char* rhs) const
{
return !operator==(rhs);
}
inline four_cc::operator unsigned long() const
{
return code_as_long;
}
inline unsigned long four_cc::as_long() const
{
return code_as_long;
}
inline char four_cc::operator[](int i) const
{
return code[i];
}
inline four_cc& four_cc::operator=(unsigned long val)
{
code_as_long = val;
return *this;
}
inline std::ostream& operator<<(std::ostream& os, const four_cc& rhs)
{
return rhs.put(os);
}
#endif

View File

@@ -10,22 +10,16 @@
#include "vpx_ports/config.h"
#include "g_common.h"
#include "subpixel.h"
#include "loopfilter.h"
#include "recon.h"
#include "idct.h"
#include "onyxc_int.h"
#include "vp8/common/g_common.h"
#include "vp8/common/subpixel.h"
#include "vp8/common/loopfilter.h"
#include "vp8/common/recon.h"
#include "vp8/common/idct.h"
#include "vp8/common/onyxc_int.h"
extern void vp8_arch_x86_common_init(VP8_COMMON *ctx);
extern void vp8_arch_arm_common_init(VP8_COMMON *ctx);
void (*vp8_build_intra_predictors_mby_ptr)(MACROBLOCKD *x);
extern void vp8_build_intra_predictors_mby(MACROBLOCKD *x);
void (*vp8_build_intra_predictors_mby_s_ptr)(MACROBLOCKD *x);
extern void vp8_build_intra_predictors_mby_s(MACROBLOCKD *x);
void vp8_machine_specific_config(VP8_COMMON *ctx)
{
#if CONFIG_RUNTIME_CPU_DETECT
@@ -45,6 +39,10 @@ void vp8_machine_specific_config(VP8_COMMON *ctx)
rtcd->recon.recon4 = vp8_recon4b_c;
rtcd->recon.recon_mb = vp8_recon_mb_c;
rtcd->recon.recon_mby = vp8_recon_mby_c;
rtcd->recon.build_intra_predictors_mby =
vp8_build_intra_predictors_mby;
rtcd->recon.build_intra_predictors_mby_s =
vp8_build_intra_predictors_mby_s;
rtcd->subpix.sixtap16x16 = vp8_sixtap_predict16x16_c;
rtcd->subpix.sixtap8x8 = vp8_sixtap_predict8x8_c;
@@ -75,9 +73,6 @@ void vp8_machine_specific_config(VP8_COMMON *ctx)
#endif
#endif
/* Pure C: */
vp8_build_intra_predictors_mby_ptr = vp8_build_intra_predictors_mby;
vp8_build_intra_predictors_mby_s_ptr = vp8_build_intra_predictors_mby_s;
#if ARCH_X86 || ARCH_X86_64
vp8_arch_x86_common_init(ctx);

View File

@@ -17,7 +17,7 @@ typedef enum
DEST = 1
} BLOCKSET;
void vp8_setup_block
static void setup_block
(
BLOCKD *b,
int mv_stride,
@@ -43,7 +43,8 @@ void vp8_setup_block
}
void vp8_setup_macroblock(MACROBLOCKD *x, BLOCKSET bs)
static void setup_macroblock(MACROBLOCKD *x, BLOCKSET bs)
{
int block;
@@ -64,16 +65,16 @@ void vp8_setup_macroblock(MACROBLOCKD *x, BLOCKSET bs)
for (block = 0; block < 16; block++) /* y blocks */
{
vp8_setup_block(&x->block[block], x->dst.y_stride, y, x->dst.y_stride,
setup_block(&x->block[block], x->dst.y_stride, y, x->dst.y_stride,
(block >> 2) * 4 * x->dst.y_stride + (block & 3) * 4, bs);
}
for (block = 16; block < 20; block++) /* U and V blocks */
{
vp8_setup_block(&x->block[block], x->dst.uv_stride, u, x->dst.uv_stride,
setup_block(&x->block[block], x->dst.uv_stride, u, x->dst.uv_stride,
((block - 16) >> 1) * 4 * x->dst.uv_stride + (block & 1) * 4, bs);
vp8_setup_block(&x->block[block+4], x->dst.uv_stride, v, x->dst.uv_stride,
setup_block(&x->block[block+4], x->dst.uv_stride, v, x->dst.uv_stride,
((block - 16) >> 1) * 4 * x->dst.uv_stride + (block & 1) * 4, bs);
}
}
@@ -124,6 +125,6 @@ void vp8_build_block_doffsets(MACROBLOCKD *x)
{
/* handle the destination pitch features */
vp8_setup_macroblock(x, DEST);
vp8_setup_macroblock(x, PRED);
setup_macroblock(x, DEST);
setup_macroblock(x, PRED);
}

View File

@@ -1,19 +0,0 @@
/*
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef __INC_PARTIALGFUPDATE_H
#define __INC_PARTIALGFUPDATE_H
#include "onyxc_int.h"
extern void update_gf_selective(ONYX_COMMON *cm, MACROBLOCKD *x);
#endif

View File

@@ -211,7 +211,7 @@ void vp8_post_proc_down_and_across_c
}
}
int vp8_q2mbl(int x)
static int q2mbl(int x)
{
if (x < 20) x = 20;
@@ -314,8 +314,8 @@ static void vp8_deblock_and_de_macro_block(YV12_BUFFER_CONFIG *source,
(void) flag;
POSTPROC_INVOKE(rtcd, downacross)(source->y_buffer, post->y_buffer, source->y_stride, post->y_stride, source->y_height, source->y_width, ppl);
POSTPROC_INVOKE(rtcd, across)(post->y_buffer, post->y_stride, post->y_height, post->y_width, vp8_q2mbl(q));
POSTPROC_INVOKE(rtcd, down)(post->y_buffer, post->y_stride, post->y_height, post->y_width, vp8_q2mbl(q));
POSTPROC_INVOKE(rtcd, across)(post->y_buffer, post->y_stride, post->y_height, post->y_width, q2mbl(q));
POSTPROC_INVOKE(rtcd, down)(post->y_buffer, post->y_stride, post->y_height, post->y_width, q2mbl(q));
POSTPROC_INVOKE(rtcd, downacross)(source->u_buffer, post->u_buffer, source->uv_stride, post->uv_stride, source->uv_height, source->uv_width, ppl);
POSTPROC_INVOKE(rtcd, downacross)(source->v_buffer, post->v_buffer, source->uv_stride, post->uv_stride, source->uv_height, source->uv_width, ppl);

View File

@@ -1,44 +0,0 @@
/*
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include <stdlib.h>
#include "blockd.h"
void vp8_predict_dc(short *lastdc, short *thisdc, short quant, short *cons)
{
int diff;
int sign;
int last_dc = *lastdc;
int this_dc = *thisdc;
if (*cons > DCPREDCNTTHRESH)
{
this_dc += last_dc;
}
diff = abs(last_dc - this_dc);
sign = (last_dc >> 31) ^(this_dc >> 31);
sign |= (!last_dc | !this_dc);
if (sign)
{
*cons = 0;
}
else
{
if (diff <= DCPREDSIMTHRESH * quant)
(*cons)++ ;
}
*thisdc = this_dc;
*lastdc = this_dc;
}

View File

@@ -1,18 +0,0 @@
/*
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef __PREDICTDC_H
#define __PREDICTDC_H
void uvvp8_predict_dc(short *lastdc, short *thisdc, short quant, short *cons);
void vp8_predict_dc(short *lastdc, short *thisdc, short quant, short *cons);
#endif

View File

@@ -1,71 +0,0 @@
/*
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
typedef struct core_codec *codec_ptr;
typedef struct interface_table *interface_ptr;
typedef struct
{
void (*Initialize)();
void (*Shutdown)();
codec_ptr(*Create)();
int (*compress_frame)(codec_ptr, unsigned int *frame_flags, YV12_BUFFER_CONFIG *sd, unsigned long *size, char *dest, INT64 time_stamp);
int (*show_frame)(codec_ptr , YV12_BUFFER_CONFIG *dest, int deblock_level, int noise_level, int flags);
void (*Remove)(codec_ptr *comp);
interface_ptr(*get_interface)(unsigned int id);
} core_codec;
typedef struct
{
int (*set_bitrate)(codec_ptr, END_USAGE usage, int Datarate);
int (*get_bitrate)(codec_ptr, END_USAGE *usage, int *Datarate);
int (*set_mode)(codec_ptr, MODE mode, int Speed, char *File);
int (*get_mode)(codec_ptr, MODE *mode, int *Speed, char **File);
} codec_settings_basic;
typedef struct
{
int (*set_bitrate)(codec_ptr, END_USAGE usage, int Datarate);
int (*get_bitrate)(codec_ptr, END_USAGE *usage, int *Datarate);
int (*set_mode)(codec_ptr, MODE mode, int Speed, char *File);
int (*get_mode)(codec_ptr, MODE *mode, int *Speed, char **File);
int (*set_denoise)(codec_ptr, int Level);
int (*get_denoise)(codec_ptr, int *Level);
int (*set_sharpness)(codec_ptr, int sharpness);
int (*get_sharpness)(codec_ptr, int *sharpness);
int (*set_keyframing)(codec_ptr, int Auto, int max_distance);
int (*get_keyframing)(codec_ptr, int *Auto, int *max_distance);
int (*set_buffering)(codec_ptr, int buffer_level, int max_buffer_level);
int (*get_buffering)(codec_ptr, int *buffer_level, int *max_buffer_level);
int (*set_adjust_frame_rate)(codec_ptr, int Allowed, int at_buffer_level_pct);
int (*get_adjust_frame_rate)(codec_ptr, int *Allowed, int *at_buffer_level_pct);
int (*set_adjust_frame_size)(codec_ptr, int Allowed, int down_at_buffer_level_pct, int up_at_buffer_level_pct);
int (*get_adjust_frame_size)(codec_ptr, int *Allowed, int *down_at_buffer_level_pct, int *up_at_buffer_level_pct);
int (*set_adjust_quality)(codec_ptr, int Allowed, int min_quantizer, int max_quantizer);
int (*get_adjust_quality)(codec_ptr, int *Allowed, int *min_quantizer, int *max_quantizer);
int (*set_vbrparms)(codec_ptr, int Bias, int Min, int Max);
int (*get_vbrparms)(codec_ptr, int *Bias, int *Min, int *Max);
} codec_settings_v1;
typedef struct
{
int (*request_recovery)(codec_ptr);
int (*request_droppable)(codec_ptr);
int (*internal_size)(codec_ptr, VPX_SCALING Vertical, VPX_SCALING Horizontal);
int (*update_last)(codec_ptr);
int (*update_gold)(codec_ptr);
int (*use_only_last)(codec_ptr);
int (*use_only_gold)(codec_ptr);
int (*update_entropy)(codec_ptr);
} codec_realtime_requests;

View File

@@ -23,6 +23,9 @@
#define prototype_recon_macroblock(sym) \
void sym(const struct vp8_recon_rtcd_vtable *rtcd, MACROBLOCKD *x)
#define prototype_build_intra_predictors(sym) \
void sym(MACROBLOCKD *x)
struct vp8_recon_rtcd_vtable;
#if ARCH_X86 || ARCH_X86_64
@@ -73,9 +76,23 @@ extern prototype_recon_macroblock(vp8_recon_recon_mb);
#endif
extern prototype_recon_macroblock(vp8_recon_recon_mby);
#ifndef vp8_recon_build_intra_predictors_mby
#define vp8_recon_build_intra_predictors_mby vp8_build_intra_predictors_mby
#endif
extern prototype_build_intra_predictors\
(vp8_recon_build_intra_predictors_mby);
#ifndef vp8_recon_build_intra_predictors_mby_s
#define vp8_recon_build_intra_predictors_mby_s vp8_build_intra_predictors_mby_s
#endif
extern prototype_build_intra_predictors\
(vp8_recon_build_intra_predictors_mby_s);
typedef prototype_copy_block((*vp8_copy_block_fn_t));
typedef prototype_recon_block((*vp8_recon_fn_t));
typedef prototype_recon_macroblock((*vp8_recon_mb_fn_t));
typedef prototype_build_intra_predictors((*vp8_build_intra_pred_fn_t));
typedef struct vp8_recon_rtcd_vtable
{
vp8_copy_block_fn_t copy16x16;
@@ -86,6 +103,8 @@ typedef struct vp8_recon_rtcd_vtable
vp8_recon_fn_t recon4;
vp8_recon_mb_fn_t recon_mb;
vp8_recon_mb_fn_t recon_mby;
vp8_build_intra_pred_fn_t build_intra_predictors_mby_s;
vp8_build_intra_pred_fn_t build_intra_predictors_mby;
} vp8_recon_rtcd_vtable_t;
#if CONFIG_RUNTIME_CPU_DETECT
@@ -94,6 +113,5 @@ typedef struct vp8_recon_rtcd_vtable
#define RECON_INVOKE(ctx,fn) vp8_recon_##fn
#endif
void vp8_recon_intra4x4mb(const vp8_recon_rtcd_vtable_t *rtcd, MACROBLOCKD *x);
void vp8_recon_intra_mbuv(const vp8_recon_rtcd_vtable_t *rtcd, MACROBLOCKD *x);
#endif

View File

@@ -168,7 +168,7 @@ void vp8_build_inter_predictors_b(BLOCKD *d, int pitch, vp8_subpix_fn_t sppf)
}
}
void vp8_build_inter_predictors4b(MACROBLOCKD *x, BLOCKD *d, int pitch)
static void build_inter_predictors4b(MACROBLOCKD *x, BLOCKD *d, int pitch)
{
unsigned char *ptr_base;
unsigned char *ptr;
@@ -187,7 +187,7 @@ void vp8_build_inter_predictors4b(MACROBLOCKD *x, BLOCKD *d, int pitch)
}
}
void vp8_build_inter_predictors2b(MACROBLOCKD *x, BLOCKD *d, int pitch)
static void build_inter_predictors2b(MACROBLOCKD *x, BLOCKD *d, int pitch)
{
unsigned char *ptr_base;
unsigned char *ptr;
@@ -246,7 +246,7 @@ void vp8_build_inter_predictors_mbuv(MACROBLOCKD *x)
BLOCKD *d1 = &x->block[i+1];
if (d0->bmi.mv.as_int == d1->bmi.mv.as_int)
vp8_build_inter_predictors2b(x, d0, 8);
build_inter_predictors2b(x, d0, 8);
else
{
vp8_build_inter_predictors_b(d0, 8, x->subpixel_predict);
@@ -291,7 +291,7 @@ void vp8_build_inter_predictors_mby(MACROBLOCKD *x)
for (i = 0; i < 4; i++)
{
BLOCKD *d = &x->block[bbb[i]];
vp8_build_inter_predictors4b(x, d, 16);
build_inter_predictors4b(x, d, 16);
}
}
@@ -303,7 +303,7 @@ void vp8_build_inter_predictors_mby(MACROBLOCKD *x)
BLOCKD *d1 = &x->block[i+1];
if (d0->bmi.mv.as_int == d1->bmi.mv.as_int)
vp8_build_inter_predictors2b(x, d0, 16);
build_inter_predictors2b(x, d0, 16);
else
{
vp8_build_inter_predictors_b(d0, 16, x->subpixel_predict);
@@ -372,7 +372,7 @@ void vp8_build_inter_predictors_mb(MACROBLOCKD *x)
for (i = 0; i < 4; i++)
{
BLOCKD *d = &x->block[bbb[i]];
vp8_build_inter_predictors4b(x, d, 16);
build_inter_predictors4b(x, d, 16);
}
}
else
@@ -383,7 +383,7 @@ void vp8_build_inter_predictors_mb(MACROBLOCKD *x)
BLOCKD *d1 = &x->block[i+1];
if (d0->bmi.mv.as_int == d1->bmi.mv.as_int)
vp8_build_inter_predictors2b(x, d0, 16);
build_inter_predictors2b(x, d0, 16);
else
{
vp8_build_inter_predictors_b(d0, 16, x->subpixel_predict);
@@ -400,7 +400,7 @@ void vp8_build_inter_predictors_mb(MACROBLOCKD *x)
BLOCKD *d1 = &x->block[i+1];
if (d0->bmi.mv.as_int == d1->bmi.mv.as_int)
vp8_build_inter_predictors2b(x, d0, 8);
build_inter_predictors2b(x, d0, 8);
else
{
vp8_build_inter_predictors_b(d0, 8, x->subpixel_predict);
@@ -600,7 +600,7 @@ void vp8_build_inter_predictors_mb_s(MACROBLOCKD *x)
for (i = 0; i < 4; i++)
{
BLOCKD *d = &x->block[bbb[i]];
/*vp8_build_inter_predictors4b(x, d, 16);*/
/*build_inter_predictors4b(x, d, 16);*/
{
unsigned char *ptr_base;
@@ -630,7 +630,7 @@ void vp8_build_inter_predictors_mb_s(MACROBLOCKD *x)
if (d0->bmi.mv.as_int == d1->bmi.mv.as_int)
{
/*vp8_build_inter_predictors2b(x, d0, 16);*/
/*build_inter_predictors2b(x, d0, 16);*/
unsigned char *ptr_base;
unsigned char *ptr;
unsigned char *pred_ptr = d0->predictor;
@@ -662,7 +662,7 @@ void vp8_build_inter_predictors_mb_s(MACROBLOCKD *x)
if (d0->bmi.mv.as_int == d1->bmi.mv.as_int)
{
/*vp8_build_inter_predictors2b(x, d0, 8);*/
/*build_inter_predictors2b(x, d0, 8);*/
unsigned char *ptr_base;
unsigned char *ptr;
unsigned char *pred_ptr = d0->predictor;

View File

@@ -14,13 +14,6 @@
extern void init_intra_left_above_pixels(MACROBLOCKD *x);
extern void (*vp8_build_intra_predictors_mby_ptr)(MACROBLOCKD *x);
extern void vp8_build_intra_predictors_mby(MACROBLOCKD *x);
extern void vp8_build_intra_predictors_mby_neon(MACROBLOCKD *x);
extern void (*vp8_build_intra_predictors_mby_s_ptr)(MACROBLOCKD *x);
extern void vp8_build_intra_predictors_mby_s(MACROBLOCKD *x);
extern void vp8_build_intra_predictors_mby_s_neon(MACROBLOCKD *x);
extern void vp8_build_intra_predictors_mbuv(MACROBLOCKD *x);
extern void vp8_build_intra_predictors_mbuv_s(MACROBLOCKD *x);

View File

@@ -313,89 +313,3 @@ void vp8_intra_prediction_down_copy(MACROBLOCKD *x)
}
void vp8_recon_intra4x4mb(const vp8_recon_rtcd_vtable_t *rtcd, MACROBLOCKD *x)
{
int i;
vp8_intra_prediction_down_copy(x);
#if ARCH_ARM
{
BLOCKD *b = &x->block[0];
vp8_predict_intra4x4(b, b->bmi.mode, b->predictor);
RECON_INVOKE(rtcd, recon)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride);
b += 1;
vp8_predict_intra4x4(b, b->bmi.mode, b->predictor);
RECON_INVOKE(rtcd, recon)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride);
b += 1;
vp8_predict_intra4x4(b, b->bmi.mode, b->predictor);
RECON_INVOKE(rtcd, recon)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride);
b += 1;
vp8_predict_intra4x4(b, b->bmi.mode, b->predictor);
RECON_INVOKE(rtcd, recon)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride);
b += 1;
vp8_predict_intra4x4(b, b->bmi.mode, b->predictor);
RECON_INVOKE(rtcd, recon)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride);
b += 1;
vp8_predict_intra4x4(b, b->bmi.mode, b->predictor);
RECON_INVOKE(rtcd, recon)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride);
b += 1;
vp8_predict_intra4x4(b, b->bmi.mode, b->predictor);
RECON_INVOKE(rtcd, recon)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride);
b += 1;
vp8_predict_intra4x4(b, b->bmi.mode, b->predictor);
RECON_INVOKE(rtcd, recon)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride);
b += 1;
vp8_predict_intra4x4(b, b->bmi.mode, b->predictor);
RECON_INVOKE(rtcd, recon)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride);
b += 1;
vp8_predict_intra4x4(b, b->bmi.mode, b->predictor);
RECON_INVOKE(rtcd, recon)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride);
b += 1;
vp8_predict_intra4x4(b, b->bmi.mode, b->predictor);
RECON_INVOKE(rtcd, recon)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride);
b += 1;
vp8_predict_intra4x4(b, b->bmi.mode, b->predictor);
RECON_INVOKE(rtcd, recon)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride);
b += 1;
vp8_predict_intra4x4(b, b->bmi.mode, b->predictor);
RECON_INVOKE(rtcd, recon)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride);
b += 1;
vp8_predict_intra4x4(b, b->bmi.mode, b->predictor);
RECON_INVOKE(rtcd, recon)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride);
b += 1;
vp8_predict_intra4x4(b, b->bmi.mode, b->predictor);
RECON_INVOKE(rtcd, recon)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride);
b += 1;
vp8_predict_intra4x4(b, b->bmi.mode, b->predictor);
RECON_INVOKE(rtcd, recon)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride);
}
#else
for (i = 0; i < 16; i++)
{
BLOCKD *b = &x->block[i];
vp8_predict_intra4x4(b, x->block[i].bmi.mode, x->block[i].predictor);
RECON_INVOKE(rtcd, recon)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride);
}
#endif
vp8_recon_intra_mbuv(rtcd, x);
}

View File

@@ -38,6 +38,7 @@
#define pthread_self() GetCurrentThreadId()
#else
#ifdef __APPLE__
#include <mach/mach_init.h>
#include <mach/semaphore.h>
#include <mach/task.h>
#include <time.h>

View File

@@ -1,76 +0,0 @@
/*
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#if !defined(VFWSETTING_HPP)
#define VFWSETTING_HPP
//______________________________________________________________________________
//
// VFWSetting.hpp
//
#include "four_cc.hpp"
#include <iosfwd>
namespace vpxvp
{
//--------------------------------------
class VFWSetting
{
friend std::ostream& operator<<(std::ostream& os, const VFWSetting& vfws);
public:
enum Mode
{
m_setting,
m_config
};
enum
{
header_size = 8,
Size = 16
};
VFWSetting(four_cc fcc);
~VFWSetting();
four_cc fcc() const;
Mode mode() const;
int setting() const;
int value() const;
void setting_value(int i_setting, int i_value); // Sets mode to m_setting
long size() const;
const void* data() const;
int data(const void* p_data, unsigned long ul_size);
private:
VFWSetting(const VFWSetting& vfws); // Not implemented
VFWSetting& operator=(const VFWSetting& vfws); // Not implemented
int extract_(const void* p_data, unsigned long ul_size);
void update_() const;
four_cc m_fcc;
Mode m_mode;
int m_i_setting;
int m_i_value;
mutable unsigned char m_p_data[Size];
};
} // namespace vpxvp
#endif // VFWSETTING_HPP

View File

@@ -1,24 +0,0 @@
/*
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef _VPX_REF_BUILD_PREFIX_h
#define _VPX_REF_BUILD_PREFIX_h
#if defined(__cplusplus)
extern "C" {
#endif
#if defined(__cplusplus)
}
#endif
#endif /* include guards */

View File

@@ -1,112 +0,0 @@
/*
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef VPXBLIT_H_INCL
#define VPXBLIT_H_INCL
/*==============================================================================
Includes
==============================================================================*/
/*==============================================================================
Defines
==============================================================================*/
#ifdef VPX_BIG_ENDIAN
#define BYTE_ZERO(X) ((X & 0xFF000000) >> (24 - 2) )
#define BYTE_ONE(X) ((X & 0x00FF0000) >> (16 - 2) )
#define BYTE_TWO(X) ((X & 0x0000FF00) >> (8 - 2) )
#define BYTE_THREE(X) ((X & 0x000000FF) << (0 + 2) )
#define BYTE_ZERO_UV(X) ((X & 0x0000FF00) >> (8 - 2) )
#define BYTE_ONE_UV(X) ((X & 0x000000FF) << (0 + 2) )
#define REREFERENCE(X) (*((int *) &(X)))
#else
#define BYTE_THREE(X) ((X & 0xFF000000) >> (24 - 2) )
#define BYTE_TWO(X) ((X & 0x00FF0000) >> (16 - 2) )
#define BYTE_ONE(X) ((X & 0x0000FF00) >> (8 - 2) )
#define BYTE_ZERO(X) ((X & 0x000000FF) << (0 + 2) )
#define BYTE_ONE_UV(X) ((X & 0x0000FF00) >> (8 - 2) )
#define BYTE_ZERO_UV(X) ((X & 0x000000FF) << (0 + 2) )
#define REREFERENCE(X) (*((int *) &(X)))
#endif
/*==============================================================================
Type Definitions
==============================================================================*/
typedef struct // YUV buffer configuration structure
{
int y_width;
int y_height;
int y_stride;
int uv_width;
int uv_height;
int uv_stride;
char *y_buffer;
char *u_buffer;
char *v_buffer;
char *uv_start;
int uv_dst_area;
int uv_used_area;
} VPX_BLIT_CONFIG;
typedef struct tx86_params
{
unsigned int pushed_registers[6];
unsigned int return_address;
unsigned int dst;
unsigned int scrn_pitch;
VPX_BLIT_CONFIG *buff_config;
} x86_params;
/*=============================================================================
Enums
==============================================================================*/
/*==============================================================================
Structures
==============================================================================*/
/*==============================================================================
Constants
==============================================================================*/
/*==============================================================================
Variables
==============================================================================*/
/*==============================================================================
Function Protoypes/MICROS
==============================================================================*/
int vpx_get_size_of_pixel(unsigned int bd);
void *vpx_get_blitter(unsigned int bd);
void vpx_set_blit(void);
void vpx_destroy_blit(void);
#endif //VPXBLIT_H_INCL

View File

@@ -1,48 +0,0 @@
/*
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef _VPX_BLIT_C64_h
#define _VPX_BLIT_C64_h
/****************************************************************************
* Typedefs
****************************************************************************/
typedef struct // YUV buffer configuration structure
{
int y_width;
int y_height;
int y_stride;
int uv_width;
int uv_height;
int uv_stride;
unsigned char *y_buffer;
unsigned char *u_buffer;
unsigned char *v_buffer;
unsigned char *y_ptr_scrn;
unsigned char *u_ptr_scrn;
unsigned char *v_ptr_scrn;
} DXV_YUV_BUFFER_CONFIG;
typedef struct
{
unsigned char *rgbptr_scrn;
unsigned char *y_ptr_scrn;
unsigned char *u_ptr_scrn;
unsigned char *v_ptr_scrn;
unsigned char *rgbptr_scrn2;
} DXV_FINAL_VIDEO;
#endif /* include guards */

View File

@@ -1,13 +0,0 @@
/*
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#define ALLOC_FAILURE -2

View File

@@ -10,7 +10,7 @@
#include "vpx_ports/config.h"
#include "loopfilter.h"
#include "vp8/common/loopfilter.h"
prototype_loopfilter(vp8_loop_filter_horizontal_edge_c);
prototype_loopfilter(vp8_loop_filter_vertical_edge_c);

View File

@@ -113,97 +113,6 @@ nextrow:
ret
;
; THIS FUNCTION APPEARS TO BE UNUSED
;
;void vp8_filter_block1d_v6_mmx
;(
; short *src_ptr,
; unsigned char *output_ptr,
; unsigned int pixels_per_line,
; unsigned int pixel_step,
; unsigned int output_height,
; unsigned int output_width,
; short * vp8_filter
;)
global sym(vp8_filter_block1d_v6_mmx)
sym(vp8_filter_block1d_v6_mmx):
push rbp
mov rbp, rsp
SHADOW_ARGS_TO_STACK 7
GET_GOT rbx
push rsi
push rdi
; end prolog
movq mm5, [GLOBAL(rd)]
push rbx
mov rbx, arg(6) ;vp8_filter
movq mm1, [rbx + 16] ; do both the negative taps first!!!
movq mm2, [rbx + 32] ;
movq mm6, [rbx + 48] ;
movq mm7, [rbx + 64] ;
movsxd rdx, dword ptr arg(2) ;pixels_per_line
mov rdi, arg(1) ;output_ptr
mov rsi, arg(0) ;src_ptr
sub rsi, rdx
sub rsi, rdx
movsxd rcx, DWORD PTR arg(4) ;output_height
movsxd rax, DWORD PTR arg(5) ;output_width ; destination pitch?
pxor mm0, mm0 ; mm0 = 00000000
nextrow_v:
movq mm3, [rsi+rdx] ; mm3 = p0..p8 = row -1
pmullw mm3, mm1 ; mm3 *= kernel 1 modifiers.
movq mm4, [rsi + 4*rdx] ; mm4 = p0..p3 = row 2
pmullw mm4, mm7 ; mm4 *= kernel 4 modifiers.
paddsw mm3, mm4 ; mm3 += mm4
movq mm4, [rsi + 2*rdx] ; mm4 = p0..p3 = row 0
pmullw mm4, mm2 ; mm4 *= kernel 2 modifiers.
paddsw mm3, mm4 ; mm3 += mm4
movq mm4, [rsi] ; mm4 = p0..p3 = row -2
pmullw mm4, [rbx] ; mm4 *= kernel 0 modifiers.
paddsw mm3, mm4 ; mm3 += mm4
add rsi, rdx ; move source forward 1 line to avoid 3 * pitch
movq mm4, [rsi + 2*rdx] ; mm4 = p0..p3 = row 1
pmullw mm4, mm6 ; mm4 *= kernel 3 modifiers.
paddsw mm3, mm4 ; mm3 += mm4
movq mm4, [rsi + 4*rdx] ; mm4 = p0..p3 = row 3
pmullw mm4, [rbx +80] ; mm4 *= kernel 3 modifiers.
paddsw mm3, mm4 ; mm3 += mm4
paddsw mm3, mm5 ; mm3 += round value
psraw mm3, VP8_FILTER_SHIFT ; mm3 /= 128
packuswb mm3, mm0 ; pack and saturate
movd [rdi],mm3 ; store the results in the destination
add rdi,rax;
dec rcx ; decrement count
jnz nextrow_v ; next row
pop rbx
; begin epilog
pop rdi
pop rsi
RESTORE_GOT
UNSHADOW_ARGS
pop rbp
ret
;void vp8_filter_block1dc_v6_mmx
;(
; short *src_ptr,

View File

@@ -11,7 +11,7 @@
#include "vpx_ports/config.h"
#include "vpx_ports/mem.h"
#include "subpixel.h"
#include "vp8/common/subpixel.h"
extern const short vp8_six_tap_mmx[8][6*8];
extern const short vp8_bilinear_filters_mmx[8][2*8];

View File

@@ -11,13 +11,13 @@
#include "vpx_ports/config.h"
#include "vpx_ports/x86.h"
#include "g_common.h"
#include "subpixel.h"
#include "loopfilter.h"
#include "recon.h"
#include "idct.h"
#include "pragmas.h"
#include "onyxc_int.h"
#include "vp8/common/g_common.h"
#include "vp8/common/subpixel.h"
#include "vp8/common/loopfilter.h"
#include "vp8/common/recon.h"
#include "vp8/common/idct.h"
#include "vp8/common/pragmas.h"
#include "vp8/common/onyxc_int.h"
void vp8_arch_x86_common_init(VP8_COMMON *ctx)
{

View File

@@ -11,11 +11,11 @@
#include "vpx_ports/config.h"
#include "vpx_ports/arm.h"
#include "blockd.h"
#include "pragmas.h"
#include "postproc.h"
#include "dequantize.h"
#include "onyxd_int.h"
#include "vp8/common/blockd.h"
#include "vp8/common/pragmas.h"
#include "vp8/common/postproc.h"
#include "vp8/decoder/dequantize.h"
#include "vp8/decoder/onyxd_int.h"
void vp8_arch_arm_decode_init(VP8D_COMP *pbi)
{

View File

@@ -9,8 +9,8 @@
*/
#include "vpx_ports/config.h"
#include "idct.h"
#include "dequantize.h"
#include "vp8/common/idct.h"
#include "vp8/decoder/dequantize.h"
void vp8_dequant_dc_idct_add_y_block_v6
(short *q, short *dq, unsigned char *pre,

View File

@@ -10,9 +10,8 @@
#include "vpx_ports/config.h"
#include "dequantize.h"
#include "predictdc.h"
#include "idct.h"
#include "vp8/decoder/dequantize.h"
#include "vp8/common/idct.h"
#include "vpx_mem/vpx_mem.h"
#if HAVE_ARMV7

View File

@@ -9,8 +9,8 @@
*/
#include "vpx_ports/config.h"
#include "idct.h"
#include "dequantize.h"
#include "vp8/common/idct.h"
#include "vp8/decoder/dequantize.h"
/* place these declarations here because we don't want to maintain them
* outside of this scope

View File

@@ -10,10 +10,10 @@
#include "treereader.h"
#include "entropymv.h"
#include "entropymode.h"
#include "vp8/common/entropymv.h"
#include "vp8/common/entropymode.h"
#include "onyxd_int.h"
#include "findnearmv.h"
#include "vp8/common/findnearmv.h"
#if CONFIG_DEBUG
#include <assert.h>
@@ -228,15 +228,8 @@ unsigned int vp8_mv_cont_count[5][4] =
};
#endif
unsigned char vp8_mbsplit_offset[4][16] = {
{ 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 2, 8, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}
};
unsigned char vp8_mbsplit_fill_count[4] = {8, 8, 4, 1};
unsigned char vp8_mbsplit_fill_offset[4][16] = {
static const unsigned char mbsplit_fill_count[4] = {8, 8, 4, 1};
static const unsigned char mbsplit_fill_offset[4][16] = {
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15},
{ 0, 1, 4, 5, 8, 9, 12, 13, 2, 3, 6, 7, 10, 11, 14, 15},
{ 0, 1, 4, 5, 2, 3, 6, 7, 8, 9, 12, 13, 10, 11, 14, 15},
@@ -246,7 +239,7 @@ unsigned char vp8_mbsplit_fill_offset[4][16] = {
void vp8_mb_mode_mv_init(VP8D_COMP *pbi)
static void mb_mode_mv_init(VP8D_COMP *pbi)
{
vp8_reader *const bc = & pbi->bc;
MV_CONTEXT *const mvc = pbi->common.fc.mvc;
@@ -287,7 +280,7 @@ void vp8_mb_mode_mv_init(VP8D_COMP *pbi)
}
}
void vp8_read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
int mb_row, int mb_col)
{
const MV Zero = { 0, 0};
@@ -405,10 +398,10 @@ void vp8_read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
/* Fill (uniform) modes, mvs of jth subset.
Must do it here because ensuing subsets can
refer back to us via "left" or "above". */
unsigned char *fill_offset;
unsigned int fill_count = vp8_mbsplit_fill_count[s];
const unsigned char *fill_offset;
unsigned int fill_count = mbsplit_fill_count[s];
fill_offset = &vp8_mbsplit_fill_offset[s][(unsigned char)j * vp8_mbsplit_fill_count[s]];
fill_offset = &mbsplit_fill_offset[s][(unsigned char)j * mbsplit_fill_count[s]];
do {
mi->bmi[ *fill_offset] = bmi;
@@ -525,7 +518,7 @@ void vp8_decode_mode_mvs(VP8D_COMP *pbi)
MODE_INFO *mi = pbi->common.mi;
int mb_row = -1;
vp8_mb_mode_mv_init(pbi);
mb_mode_mv_init(pbi);
while (++mb_row < pbi->common.mb_rows)
{
@@ -543,11 +536,11 @@ void vp8_decode_mode_mvs(VP8D_COMP *pbi)
while (++mb_col < pbi->common.mb_cols)
{
/*vp8_read_mb_modes_mv(pbi, xd->mode_info_context, &xd->mode_info_context->mbmi, mb_row, mb_col);*/
/*read_mb_modes_mv(pbi, xd->mode_info_context, &xd->mode_info_context->mbmi, mb_row, mb_col);*/
if(pbi->common.frame_type == KEY_FRAME)
vp8_kfread_modes(pbi, mi, mb_row, mb_col);
else
vp8_read_mb_modes_mv(pbi, mi, &mi->mbmi, mb_row, mb_col);
read_mb_modes_mv(pbi, mi, &mi->mbmi, mb_row, mb_col);
mi++; /* next macroblock */
}

View File

@@ -10,28 +10,27 @@
#include "onyxd_int.h"
#include "header.h"
#include "reconintra.h"
#include "reconintra4x4.h"
#include "recon.h"
#include "reconinter.h"
#include "vp8/common/header.h"
#include "vp8/common/reconintra.h"
#include "vp8/common/reconintra4x4.h"
#include "vp8/common/recon.h"
#include "vp8/common/reconinter.h"
#include "dequantize.h"
#include "detokenize.h"
#include "invtrans.h"
#include "alloccommon.h"
#include "entropymode.h"
#include "quant_common.h"
#include "vp8/common/invtrans.h"
#include "vp8/common/alloccommon.h"
#include "vp8/common/entropymode.h"
#include "vp8/common/quant_common.h"
#include "vpx_scale/vpxscale.h"
#include "vpx_scale/yv12extend.h"
#include "setupintrarecon.h"
#include "vp8/common/setupintrarecon.h"
#include "decodemv.h"
#include "extend.h"
#include "vp8/common/extend.h"
#include "vpx_mem/vpx_mem.h"
#include "idct.h"
#include "vp8/common/idct.h"
#include "dequantize.h"
#include "predictdc.h"
#include "threading.h"
#include "vp8/common/threading.h"
#include "decoderthreading.h"
#include "dboolhuff.h"
@@ -116,8 +115,8 @@ static void skip_recon_mb(VP8D_COMP *pbi, MACROBLOCKD *xd)
{
vp8_build_intra_predictors_mbuv_s(xd);
vp8_build_intra_predictors_mby_s_ptr(xd);
RECON_INVOKE(&pbi->common.rtcd.recon,
build_intra_predictors_mby_s)(xd);
}
else
{
@@ -176,7 +175,7 @@ void clamp_mvs(MACROBLOCKD *xd)
}
void vp8_decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd)
static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd)
{
int eobtotal = 0;
int i, do_clamp = xd->mode_info_context->mbmi.need_to_clamp_mvs;
@@ -215,7 +214,8 @@ void vp8_decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd)
if (xd->mode_info_context->mbmi.mode != B_PRED)
{
vp8_build_intra_predictors_mby_ptr(xd);
RECON_INVOKE(&pbi->common.rtcd.recon,
build_intra_predictors_mby)(xd);
} else {
vp8_intra_prediction_down_copy(xd);
}
@@ -320,10 +320,8 @@ FILE *vpxlog = 0;
void vp8_decode_mb_row(VP8D_COMP *pbi,
VP8_COMMON *pc,
int mb_row,
MACROBLOCKD *xd)
static void
decode_mb_row(VP8D_COMP *pbi, VP8_COMMON *pc, int mb_row, MACROBLOCKD *xd)
{
int i;
@@ -395,7 +393,7 @@ void vp8_decode_mb_row(VP8D_COMP *pbi,
else
pbi->debugoutput =0;
*/
vp8_decode_macroblock(pbi, xd);
decode_macroblock(pbi, xd);
/* check if the boolean decoder has suffered an error */
xd->corrupted |= vp8dx_bool_error(xd->current_bc);
@@ -901,7 +899,7 @@ int vp8_decode_frame(VP8D_COMP *pbi)
ibc = 0;
}
vp8_decode_mb_row(pbi, pc, mb_row, xd);
decode_mb_row(pbi, pc, mb_row, xd);
}
}

View File

@@ -11,8 +11,7 @@
#include "vpx_ports/config.h"
#include "dequantize.h"
#include "predictdc.h"
#include "idct.h"
#include "vp8/common/idct.h"
#include "vpx_mem/vpx_mem.h"
extern void vp8_short_idct4x4llm_c(short *input, short *output, int pitch) ;

View File

@@ -11,7 +11,7 @@
#ifndef DEQUANTIZE_H
#define DEQUANTIZE_H
#include "blockd.h"
#include "vp8/common/blockd.h"
#define prototype_dequant_block(sym) \
void sym(BLOCKD *x)

View File

@@ -9,8 +9,8 @@
*/
#include "type_aliases.h"
#include "blockd.h"
#include "vp8/common/type_aliases.h"
#include "vp8/common/blockd.h"
#include "onyxd_int.h"
#include "vpx_mem/vpx_mem.h"
#include "vpx_ports/mem.h"
@@ -19,7 +19,13 @@
#define BOOL_DATA UINT8
#define OCB_X PREV_COEF_CONTEXTS * ENTROPY_NODES
DECLARE_ALIGNED(16, UINT8, vp8_coef_bands_x[16]) = { 0, 1 * OCB_X, 2 * OCB_X, 3 * OCB_X, 6 * OCB_X, 4 * OCB_X, 5 * OCB_X, 6 * OCB_X, 6 * OCB_X, 6 * OCB_X, 6 * OCB_X, 6 * OCB_X, 6 * OCB_X, 6 * OCB_X, 6 * OCB_X, 7 * OCB_X};
DECLARE_ALIGNED(16, static const unsigned char, coef_bands_x[16]) =
{
0 * OCB_X, 1 * OCB_X, 2 * OCB_X, 3 * OCB_X,
6 * OCB_X, 4 * OCB_X, 5 * OCB_X, 6 * OCB_X,
6 * OCB_X, 6 * OCB_X, 6 * OCB_X, 6 * OCB_X,
6 * OCB_X, 6 * OCB_X, 6 * OCB_X, 7 * OCB_X
};
#define EOB_CONTEXT_NODE 0
#define ZERO_CONTEXT_NODE 1
#define ONE_CONTEXT_NODE 2
@@ -135,7 +141,7 @@ DECLARE_ALIGNED(16, extern const unsigned char, vp8dx_bitreader_norm[256]);
Prob = coef_probs; \
if(c<15) {\
++c; \
Prob += vp8_coef_bands_x[c]; \
Prob += coef_bands_x[c]; \
goto branch; \
} goto BLOCK_FINISHED; /*for malformed input */\
} \
@@ -244,7 +250,7 @@ BLOCK_LOOP:
Prob += v * ENTROPY_NODES;
DO_WHILE:
Prob += vp8_coef_bands_x[c];
Prob += coef_bands_x[c];
DECODE_AND_BRANCH_IF_ZERO(Prob[EOB_CONTEXT_NODE], BLOCK_FINISHED);
CHECK_0_:

View File

@@ -10,8 +10,8 @@
#include "vpx_ports/config.h"
#include "dequantize.h"
#include "onyxd_int.h"
#include "vp8/decoder/dequantize.h"
#include "vp8/decoder/onyxd_int.h"
extern void vp8_arch_x86_decode_init(VP8D_COMP *pbi);
extern void vp8_arch_arm_decode_init(VP8D_COMP *pbi);

View File

@@ -9,7 +9,7 @@
*/
#include "vpx_ports/config.h"
#include "idct.h"
#include "vp8/common/idct.h"
#include "dequantize.h"
void vp8_dequant_dc_idct_add_c(short *input, short *dq, unsigned char *pred,

View File

@@ -9,25 +9,25 @@
*/
#include "onyxc_int.h"
#include "vp8/common/onyxc_int.h"
#if CONFIG_POSTPROC
#include "postproc.h"
#include "vp8/common/postproc.h"
#endif
#include "onyxd.h"
#include "vp8/common/onyxd.h"
#include "onyxd_int.h"
#include "vpx_mem/vpx_mem.h"
#include "alloccommon.h"
#include "vp8/common/alloccommon.h"
#include "vpx_scale/yv12extend.h"
#include "loopfilter.h"
#include "swapyv12buffer.h"
#include "g_common.h"
#include "threading.h"
#include "vp8/common/loopfilter.h"
#include "vp8/common/swapyv12buffer.h"
#include "vp8/common/g_common.h"
#include "vp8/common/threading.h"
#include "decoderthreading.h"
#include <stdio.h>
#include "quant_common.h"
#include "vp8/common/quant_common.h"
#include "vpx_scale/vpxscale.h"
#include "systemdependent.h"
#include "vp8/common/systemdependent.h"
#include "vpx_ports/vpx_timer.h"
#include "detokenize.h"
#if ARCH_ARM
@@ -37,43 +37,6 @@
extern void vp8_init_loop_filter(VP8_COMMON *cm);
extern void vp8cx_init_de_quantizer(VP8D_COMP *pbi);
#if CONFIG_DEBUG
void vp8_recon_write_yuv_frame(unsigned char *name, YV12_BUFFER_CONFIG *s)
{
FILE *yuv_file = fopen((char *)name, "ab");
unsigned char *src = s->y_buffer;
int h = s->y_height;
do
{
fwrite(src, s->y_width, 1, yuv_file);
src += s->y_stride;
}
while (--h);
src = s->u_buffer;
h = s->uv_height;
do
{
fwrite(src, s->uv_width, 1, yuv_file);
src += s->uv_stride;
}
while (--h);
src = s->v_buffer;
h = s->uv_height;
do
{
fwrite(src, s->uv_width, 1, yuv_file);
src += s->uv_stride;
}
while (--h);
fclose(yuv_file);
}
#endif
void vp8dx_initialize()
{
@@ -155,35 +118,6 @@ void vp8dx_remove_decompressor(VP8D_PTR ptr)
}
void vp8dx_set_setting(VP8D_PTR comp, VP8D_SETTING oxst, int x)
{
VP8D_COMP *pbi = (VP8D_COMP *) comp;
(void) pbi;
(void) x;
switch (oxst)
{
case VP8D_OK:
break;
}
}
int vp8dx_get_setting(VP8D_PTR comp, VP8D_SETTING oxst)
{
VP8D_COMP *pbi = (VP8D_COMP *) comp;
(void) pbi;
switch (oxst)
{
case VP8D_OK:
break;
}
return -1;
}
int vp8dx_get_reference(VP8D_PTR ptr, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd)
{
VP8D_COMP *pbi = (VP8D_COMP *) ptr;
@@ -203,6 +137,8 @@ int vp8dx_get_reference(VP8D_PTR ptr, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_C
return 0;
}
int vp8dx_set_reference(VP8D_PTR ptr, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd)
{
VP8D_COMP *pbi = (VP8D_COMP *) ptr;
@@ -459,12 +395,6 @@ int vp8dx_receive_compressed_data(VP8D_PTR ptr, unsigned long size, const unsign
vp8_yv12_extend_frame_borders_ptr(cm->frame_to_show);
}
#if 0
/* DEBUG code */
/*vp8_recon_write_yuv_frame("recon.yuv", cm->frame_to_show);*/
if (cm->current_video_frame <= 5)
write_dx_frame_to_file(cm->frame_to_show, cm->current_video_frame);
#endif
vp8_clear_system_state();

View File

@@ -12,10 +12,10 @@
#ifndef __INC_VP8D_INT_H
#define __INC_VP8D_INT_H
#include "vpx_ports/config.h"
#include "onyxd.h"
#include "vp8/common/onyxd.h"
#include "treereader.h"
#include "onyxc_int.h"
#include "threading.h"
#include "vp8/common/onyxc_int.h"
#include "vp8/common/threading.h"
#include "dequantize.h"
typedef struct
@@ -113,6 +113,7 @@ typedef struct VP8Decompressor
pthread_t *h_decoding_thread;
sem_t *h_event_start_decoding;
sem_t h_event_end_decoding;
sem_t *h_mb_counter;
/* end of threading data */
#endif

View File

@@ -10,8 +10,8 @@
#include "vpx_ports/config.h"
#include "recon.h"
#include "reconintra.h"
#include "vp8/common/recon.h"
#include "vp8/common/reconintra.h"
#include "vpx_mem/vpx_mem.h"
#include "onyxd_int.h"

View File

@@ -12,18 +12,15 @@
#if !defined(WIN32) && CONFIG_OS_SUPPORT == 1
# include <unistd.h>
#endif
#ifdef __APPLE__
#include <mach/mach_init.h>
#endif
#include "onyxd_int.h"
#include "vpx_mem/vpx_mem.h"
#include "threading.h"
#include "vp8/common/threading.h"
#include "loopfilter.h"
#include "extend.h"
#include "vp8/common/loopfilter.h"
#include "vp8/common/extend.h"
#include "vpx_ports/vpx_timer.h"
#include "detokenize.h"
#include "reconinter.h"
#include "vp8/common/reconinter.h"
#include "reconintra_mt.h"
extern void mb_init_dequantizer(VP8D_COMP *pbi, MACROBLOCKD *xd);
@@ -36,7 +33,7 @@ extern void vp8_build_uvmvs(MACROBLOCKD *x, int fullpixel);
#define RTCD_VTABLE(x) NULL
#endif
void vp8_setup_decoding_thread_data(VP8D_COMP *pbi, MACROBLOCKD *xd, MB_ROW_DEC *mbrd, int count)
static void setup_decoding_thread_data(VP8D_COMP *pbi, MACROBLOCKD *xd, MB_ROW_DEC *mbrd, int count)
{
VP8_COMMON *const pc = & pbi->common;
int i, j;
@@ -90,7 +87,7 @@ void vp8_setup_decoding_thread_data(VP8D_COMP *pbi, MACROBLOCKD *xd, MB_ROW_DEC
}
void vp8mt_decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, int mb_row, int mb_col)
static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, int mb_row, int mb_col)
{
int eobtotal = 0;
int i, do_clamp = xd->mode_info_context->mbmi.need_to_clamp_mvs;
@@ -217,7 +214,7 @@ void vp8mt_decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, int mb_row, int mb
}
THREAD_FUNCTION vp8_thread_decoding_proc(void *p_data)
static THREAD_FUNCTION thread_decoding_proc(void *p_data)
{
int ithread = ((DECODETHREAD_DATA *)p_data)->ithread;
VP8D_COMP *pbi = (VP8D_COMP *)(((DECODETHREAD_DATA *)p_data)->ptr1);
@@ -278,6 +275,7 @@ THREAD_FUNCTION vp8_thread_decoding_proc(void *p_data)
for (mb_col = 0; mb_col < pc->mb_cols; mb_col++)
{
/*
if ((mb_col & (nsync-1)) == 0)
{
while (mb_col > (*last_row_current_mb_col - nsync) && *last_row_current_mb_col != pc->mb_cols - 1)
@@ -286,6 +284,8 @@ THREAD_FUNCTION vp8_thread_decoding_proc(void *p_data)
thread_sleep(0);
}
}
*/
sem_wait(&pbi->h_mb_counter[ithread]);
if (xd->mode_info_context->mbmi.mode == SPLITMV || xd->mode_info_context->mbmi.mode == B_PRED)
{
@@ -296,18 +296,6 @@ THREAD_FUNCTION vp8_thread_decoding_proc(void *p_data)
}
}
if(pbi->common.filter_level)
{
/*update loopfilter info*/
Segment = (alt_flt_enabled) ? xd->mode_info_context->mbmi.segment_id : 0;
filter_level = pbi->mt_baseline_filter_level[Segment];
/* Distance of Mb to the various image edges.
* These are specified to 8th pel as they are always compared to values that are in 1/8th pel units
* Apply any context driven MB level adjustment
*/
filter_level = vp8_adjust_mb_lf_value(xd, filter_level);
}
/* Distance of Mb to the various image edges.
* These are specified to 8th pel as they are always compared to values that are in 1/8th pel units
*/
@@ -333,7 +321,7 @@ THREAD_FUNCTION vp8_thread_decoding_proc(void *p_data)
xd->pre.v_buffer = pc->yv12_fb[ref_fb_idx].v_buffer + recon_uvoffset;
vp8_build_uvmvs(xd, pc->full_pixel);
vp8mt_decode_macroblock(pbi, xd, mb_row, mb_col);
decode_macroblock(pbi, xd, mb_row, mb_col);
if (pbi->common.filter_level)
{
@@ -362,7 +350,16 @@ THREAD_FUNCTION vp8_thread_decoding_proc(void *p_data)
}
}
/* loopfilter on this macroblock. */
/* update loopfilter info */
Segment = (alt_flt_enabled) ? xd->mode_info_context->mbmi.segment_id : 0;
filter_level = pbi->mt_baseline_filter_level[Segment];
/* Distance of Mb to the various image edges.
* These are specified to 8th pel as they are always compared to values that are in 1/8th pel units
* Apply any context driven MB level adjustment
*/
filter_level = vp8_adjust_mb_lf_value(xd, filter_level);
/* loopfilter on this macroblock. */
if (filter_level)
{
if (mb_col > 0)
@@ -389,6 +386,9 @@ THREAD_FUNCTION vp8_thread_decoding_proc(void *p_data)
/*pbi->mb_row_di[ithread].current_mb_col = mb_col;*/
pbi->mt_current_mb_col[mb_row] = mb_col;
if (mb_row != pbi->common.mb_rows-1)
sem_post(&pbi->h_mb_counter[ithread+1]);
}
/* adjust to the next row of mbs */
@@ -444,6 +444,7 @@ void vp8_decoder_create_threads(VP8D_COMP *pbi)
CHECK_MEM_ERROR(pbi->h_decoding_thread, vpx_malloc(sizeof(pthread_t) * pbi->decoding_thread_count));
CHECK_MEM_ERROR(pbi->h_event_start_decoding, vpx_malloc(sizeof(sem_t) * pbi->decoding_thread_count));
CHECK_MEM_ERROR(pbi->h_mb_counter, vpx_malloc(sizeof(sem_t) * (pbi->decoding_thread_count + 1)));
CHECK_MEM_ERROR(pbi->mb_row_di, vpx_memalign(32, sizeof(MB_ROW_DEC) * pbi->decoding_thread_count));
vpx_memset(pbi->mb_row_di, 0, sizeof(MB_ROW_DEC) * pbi->decoding_thread_count);
CHECK_MEM_ERROR(pbi->de_thread_data, vpx_malloc(sizeof(DECODETHREAD_DATA) * pbi->decoding_thread_count));
@@ -456,9 +457,12 @@ void vp8_decoder_create_threads(VP8D_COMP *pbi)
pbi->de_thread_data[ithread].ptr1 = (void *)pbi;
pbi->de_thread_data[ithread].ptr2 = (void *) &pbi->mb_row_di[ithread];
pthread_create(&pbi->h_decoding_thread[ithread], 0, vp8_thread_decoding_proc, (&pbi->de_thread_data[ithread]));
pthread_create(&pbi->h_decoding_thread[ithread], 0, thread_decoding_proc, (&pbi->de_thread_data[ithread]));
}
for (ithread = 0; ithread < pbi->decoding_thread_count + 1; ithread++)
sem_init(&pbi->h_mb_counter[ithread], 0, 0);
sem_init(&pbi->h_event_end_decoding, 0, 0);
pbi->allocated_decoding_thread_count = pbi->decoding_thread_count;
@@ -473,22 +477,16 @@ void vp8mt_de_alloc_temp_buffers(VP8D_COMP *pbi, int mb_rows)
if (pbi->b_multithreaded_rd)
{
if (pbi->mt_current_mb_col)
{
vpx_free(pbi->mt_current_mb_col);
pbi->mt_current_mb_col = NULL ;
}
/* Free above_row buffers. */
if (pbi->mt_yabove_row)
{
for (i=0; i< mb_rows; i++)
{
if (pbi->mt_yabove_row[i])
{
vpx_free(pbi->mt_yabove_row[i]);
pbi->mt_yabove_row[i] = NULL ;
}
}
vpx_free(pbi->mt_yabove_row);
pbi->mt_yabove_row = NULL ;
@@ -498,11 +496,8 @@ void vp8mt_de_alloc_temp_buffers(VP8D_COMP *pbi, int mb_rows)
{
for (i=0; i< mb_rows; i++)
{
if (pbi->mt_uabove_row[i])
{
vpx_free(pbi->mt_uabove_row[i]);
pbi->mt_uabove_row[i] = NULL ;
}
}
vpx_free(pbi->mt_uabove_row);
pbi->mt_uabove_row = NULL ;
@@ -512,11 +507,8 @@ void vp8mt_de_alloc_temp_buffers(VP8D_COMP *pbi, int mb_rows)
{
for (i=0; i< mb_rows; i++)
{
if (pbi->mt_vabove_row[i])
{
vpx_free(pbi->mt_vabove_row[i]);
pbi->mt_vabove_row[i] = NULL ;
}
}
vpx_free(pbi->mt_vabove_row);
pbi->mt_vabove_row = NULL ;
@@ -527,11 +519,8 @@ void vp8mt_de_alloc_temp_buffers(VP8D_COMP *pbi, int mb_rows)
{
for (i=0; i< mb_rows; i++)
{
if (pbi->mt_yleft_col[i])
{
vpx_free(pbi->mt_yleft_col[i]);
pbi->mt_yleft_col[i] = NULL ;
}
}
vpx_free(pbi->mt_yleft_col);
pbi->mt_yleft_col = NULL ;
@@ -541,11 +530,8 @@ void vp8mt_de_alloc_temp_buffers(VP8D_COMP *pbi, int mb_rows)
{
for (i=0; i< mb_rows; i++)
{
if (pbi->mt_uleft_col[i])
{
vpx_free(pbi->mt_uleft_col[i]);
pbi->mt_uleft_col[i] = NULL ;
}
}
vpx_free(pbi->mt_uleft_col);
pbi->mt_uleft_col = NULL ;
@@ -555,11 +541,8 @@ void vp8mt_de_alloc_temp_buffers(VP8D_COMP *pbi, int mb_rows)
{
for (i=0; i< mb_rows; i++)
{
if (pbi->mt_vleft_col[i])
{
vpx_free(pbi->mt_vleft_col[i]);
pbi->mt_vleft_col[i] = NULL ;
}
}
vpx_free(pbi->mt_vleft_col);
pbi->mt_vleft_col = NULL ;
@@ -642,36 +625,32 @@ void vp8_decoder_remove_threads(VP8D_COMP *pbi)
sem_destroy(&pbi->h_event_start_decoding[i]);
}
for (i = 0; i < pbi->decoding_thread_count + 1; i++)
sem_destroy(&pbi->h_mb_counter[i]);
sem_destroy(&pbi->h_event_end_decoding);
if (pbi->h_decoding_thread)
{
vpx_free(pbi->h_decoding_thread);
pbi->h_decoding_thread = NULL;
}
if (pbi->h_event_start_decoding)
{
vpx_free(pbi->h_event_start_decoding);
pbi->h_event_start_decoding = NULL;
}
if (pbi->mb_row_di)
if (pbi->h_mb_counter)
{
vpx_free(pbi->h_mb_counter);
pbi->h_mb_counter = NULL;
}
vpx_free(pbi->mb_row_di);
pbi->mb_row_di = NULL ;
}
if (pbi->de_thread_data)
{
vpx_free(pbi->de_thread_data);
pbi->de_thread_data = NULL;
}
}
}
void vp8mt_lpf_init( VP8D_COMP *pbi, int default_filt_lvl)
static void lpf_init( VP8D_COMP *pbi, int default_filt_lvl)
{
VP8_COMMON *cm = &pbi->common;
MACROBLOCKD *mbd = &pbi->mb;
@@ -754,14 +733,17 @@ void vp8mt_decode_mb_rows( VP8D_COMP *pbi, MACROBLOCKD *xd)
vpx_memset(pbi->mt_uleft_col[i], (unsigned char)129, 8);
vpx_memset(pbi->mt_vleft_col[i], (unsigned char)129, 8);
}
vp8mt_lpf_init(pbi, pc->filter_level);
lpf_init(pbi, pc->filter_level);
}
vp8_setup_decoding_thread_data(pbi, xd, pbi->mb_row_di, pbi->decoding_thread_count);
setup_decoding_thread_data(pbi, xd, pbi->mb_row_di, pbi->decoding_thread_count);
for (i = 0; i < pbi->decoding_thread_count; i++)
sem_post(&pbi->h_event_start_decoding[i]);
for (mb_row = 0; mb_row < pc->mb_rows; mb_row += (pbi->decoding_thread_count + 1))
{
@@ -794,6 +776,7 @@ void vp8mt_decode_mb_rows( VP8D_COMP *pbi, MACROBLOCKD *xd)
for (mb_col = 0; mb_col < pc->mb_cols; mb_col++)
{
/*
if ( mb_row > 0 && (mb_col & (nsync-1)) == 0){
while (mb_col > (*last_row_current_mb_col - nsync) && *last_row_current_mb_col != pc->mb_cols - 1)
{
@@ -801,6 +784,9 @@ void vp8mt_decode_mb_rows( VP8D_COMP *pbi, MACROBLOCKD *xd)
thread_sleep(0);
}
}
*/
if(mb_row > 0)
sem_wait(&pbi->h_mb_counter[pbi->decoding_thread_count]);
if (xd->mode_info_context->mbmi.mode == SPLITMV || xd->mode_info_context->mbmi.mode == B_PRED)
{
@@ -811,18 +797,6 @@ void vp8mt_decode_mb_rows( VP8D_COMP *pbi, MACROBLOCKD *xd)
}
}
if(pbi->common.filter_level)
{
/* update loopfilter info */
Segment = (alt_flt_enabled) ? xd->mode_info_context->mbmi.segment_id : 0;
filter_level = pbi->mt_baseline_filter_level[Segment];
/* Distance of Mb to the various image edges.
* These are specified to 8th pel as they are always compared to values that are in 1/8th pel units
* Apply any context driven MB level adjustment
*/
filter_level = vp8_adjust_mb_lf_value(xd, filter_level);
}
/* Distance of Mb to the various image edges.
* These are specified to 8th pel as they are always compared to values that are in 1/8th pel units
*/
@@ -854,7 +828,7 @@ void vp8mt_decode_mb_rows( VP8D_COMP *pbi, MACROBLOCKD *xd)
}
vp8_build_uvmvs(xd, pc->full_pixel);
vp8mt_decode_macroblock(pbi, xd, mb_row, mb_col);
decode_macroblock(pbi, xd, mb_row, mb_col);
/* check if the boolean decoder has suffered an error */
xd->corrupted |= vp8dx_bool_error(xd->current_bc);
@@ -886,6 +860,15 @@ void vp8mt_decode_mb_rows( VP8D_COMP *pbi, MACROBLOCKD *xd)
}
}
/* update loopfilter info */
Segment = (alt_flt_enabled) ? xd->mode_info_context->mbmi.segment_id : 0;
filter_level = pbi->mt_baseline_filter_level[Segment];
/* Distance of Mb to the various image edges.
* These are specified to 8th pel as they are always compared to values that are in 1/8th pel units
* Apply any context driven MB level adjustment
*/
filter_level = vp8_adjust_mb_lf_value(xd, filter_level);
/* loopfilter on this macroblock. */
if (filter_level)
{
@@ -912,6 +895,10 @@ void vp8mt_decode_mb_rows( VP8D_COMP *pbi, MACROBLOCKD *xd)
xd->above_context++;
pbi->mt_current_mb_col[mb_row] = mb_col;
/* macroblock counter */
if (mb_row != pbi->common.mb_rows-1)
sem_post(&pbi->h_mb_counter[0]);
}
/* adjust to the next row of mbs */

View File

@@ -12,7 +12,7 @@
#ifndef tree_reader_h
#define tree_reader_h 1
#include "treecoder.h"
#include "vp8/common/treecoder.h"
#include "dboolhuff.h"

View File

@@ -9,8 +9,8 @@
*/
#include "vpx_ports/config.h"
#include "idct.h"
#include "dequantize.h"
#include "vp8/common/idct.h"
#include "vp8/decoder/dequantize.h"
void vp8_dequant_dc_idct_add_y_block_mmx
(short *q, short *dq, unsigned char *pre,

View File

@@ -9,8 +9,8 @@
*/
#include "vpx_ports/config.h"
#include "idct.h"
#include "dequantize.h"
#include "vp8/common/idct.h"
#include "vp8/decoder/dequantize.h"
void idct_dequant_dc_0_2x_sse2
(short *q, short *dq, unsigned char *pre,

File diff suppressed because it is too large Load Diff

View File

@@ -11,13 +11,13 @@
#include "vpx_ports/config.h"
#include "vpx_ports/x86.h"
#include "onyxd_int.h"
#include "vp8/decoder/onyxd_int.h"
#if HAVE_MMX
void vp8_dequantize_b_impl_mmx(short *sq, short *dq, short *q);
void vp8_dequantize_b_mmx(BLOCKD *d)
static void dequantize_b_mmx(BLOCKD *d)
{
short *sq = (short *) d->qcoeff;
short *dq = (short *) d->dqcoeff;
@@ -41,7 +41,7 @@ void vp8_arch_x86_decode_init(VP8D_COMP *pbi)
#if HAVE_MMX
if (flags & HAS_MMX)
{
pbi->dequant.block = vp8_dequantize_b_mmx;
pbi->dequant.block = dequantize_b_mmx;
pbi->dequant.idct_add = vp8_dequant_idct_add_mmx;
pbi->dequant.dc_idct_add = vp8_dequant_dc_idct_add_mmx;
pbi->dequant.dc_idct_add_y_block = vp8_dequant_dc_idct_add_y_block_mmx;

View File

@@ -11,8 +11,8 @@
#include "vpx_ports/config.h"
#include "vpx_ports/arm.h"
#include "variance.h"
#include "onyx_int.h"
#include "vp8/encoder/variance.h"
#include "vp8/encoder/onyx_int.h"
extern void (*vp8_yv12_copy_partial_frame_ptr)(YV12_BUFFER_CONFIG *src_ybc, YV12_BUFFER_CONFIG *dst_ybc, int Fraction);
extern void vp8_yv12_copy_partial_frame(YV12_BUFFER_CONFIG *src_ybc, YV12_BUFFER_CONFIG *dst_ybc, int Fraction);
@@ -29,26 +29,29 @@ void vp8_arch_arm_encoder_init(VP8_COMP *cpi)
#if HAVE_ARMV6
if (has_media)
{
/*cpi->rtcd.variance.sad16x16 = vp8_sad16x16_c;
cpi->rtcd.variance.sad16x8 = vp8_sad16x8_c;
cpi->rtcd.variance.sad16x16 = vp8_sad16x16_armv6;
/*cpi->rtcd.variance.sad16x8 = vp8_sad16x8_c;
cpi->rtcd.variance.sad8x16 = vp8_sad8x16_c;
cpi->rtcd.variance.sad8x8 = vp8_sad8x8_c;
cpi->rtcd.variance.sad4x4 = vp8_sad4x4_c;*/
/*cpi->rtcd.variance.var4x4 = vp8_variance4x4_c;
cpi->rtcd.variance.var8x8 = vp8_variance8x8_c;
cpi->rtcd.variance.var8x16 = vp8_variance8x16_c;
/*cpi->rtcd.variance.var4x4 = vp8_variance4x4_c;*/
cpi->rtcd.variance.var8x8 = vp8_variance8x8_armv6;
/*cpi->rtcd.variance.var8x16 = vp8_variance8x16_c;
cpi->rtcd.variance.var16x8 = vp8_variance16x8_c;*/
cpi->rtcd.variance.var16x16 = vp8_variance16x16_armv6;
/*cpi->rtcd.variance.subpixvar4x4 = vp8_sub_pixel_variance4x4_c;
cpi->rtcd.variance.subpixvar8x8 = vp8_sub_pixel_variance8x8_c;
cpi->rtcd.variance.subpixvar8x16 = vp8_sub_pixel_variance8x16_c;
/*cpi->rtcd.variance.subpixvar4x4 = vp8_sub_pixel_variance4x4_c;*/
cpi->rtcd.variance.subpixvar8x8 = vp8_sub_pixel_variance8x8_armv6;
/*cpi->rtcd.variance.subpixvar8x16 = vp8_sub_pixel_variance8x16_c;
cpi->rtcd.variance.subpixvar16x8 = vp8_sub_pixel_variance16x8_c;*/
cpi->rtcd.variance.subpixvar16x16 = vp8_sub_pixel_variance16x16_armv6;
cpi->rtcd.variance.halfpixvar16x16_h = vp8_variance_halfpixvar16x16_h_armv6;
cpi->rtcd.variance.halfpixvar16x16_v = vp8_variance_halfpixvar16x16_v_armv6;
cpi->rtcd.variance.halfpixvar16x16_hv = vp8_variance_halfpixvar16x16_hv_armv6;
/*cpi->rtcd.variance.mse16x16 = vp8_mse16x16_c;
cpi->rtcd.variance.getmbss = vp8_get_mb_ss_c;*/
cpi->rtcd.variance.mse16x16 = vp8_mse16x16_armv6;
/*cpi->rtcd.variance.getmbss = vp8_get_mb_ss_c;*/
/*cpi->rtcd.variance.get16x16prederror = vp8_get16x16pred_error_c;
cpi->rtcd.variance.get8x8var = vp8_get8x8var_c;
@@ -56,9 +59,9 @@ void vp8_arch_arm_encoder_init(VP8_COMP *cpi)
cpi->rtcd.variance.get4x4sse_cs = vp8_get4x4sse_cs_c;*/
/*cpi->rtcd.fdct.short4x4 = vp8_short_fdct4x4_c;
cpi->rtcd.fdct.short8x4 = vp8_short_fdct8x4_c;
cpi->rtcd.fdct.fast4x4 = vp8_fast_fdct4x4_c;
cpi->rtcd.fdct.fast8x4 = vp8_fast_fdct8x4_c;*/
cpi->rtcd.fdct.short8x4 = vp8_short_fdct8x4_c;*/
cpi->rtcd.fdct.fast4x4 = vp8_fast_fdct4x4_armv6;
cpi->rtcd.fdct.fast8x4 = vp8_fast_fdct8x4_armv6;
cpi->rtcd.fdct.walsh_short4x4 = vp8_short_walsh4x4_armv6;
/*cpi->rtcd.encodemb.berr = vp8_block_error_c;
@@ -68,8 +71,8 @@ void vp8_arch_arm_encoder_init(VP8_COMP *cpi)
cpi->rtcd.encodemb.submby = vp8_subtract_mby_c;
cpi->rtcd.encodemb.submbuv = vp8_subtract_mbuv_c;*/
/*cpi->rtcd.quantize.quantb = vp8_regular_quantize_b;
cpi->rtcd.quantize.fastquantb = vp8_fast_quantize_b_c;*/
/*cpi->rtcd.quantize.quantb = vp8_regular_quantize_b;*/
cpi->rtcd.quantize.fastquantb = vp8_fast_quantize_b_armv6;
}
#endif

View File

@@ -0,0 +1,262 @@
;
; Copyright (c) 2011 The WebM project authors. All Rights Reserved.
;
; Use of this source code is governed by a BSD-style license
; that can be found in the LICENSE file in the root of the source
; tree. An additional intellectual property rights grant can be found
; in the file PATENTS. All contributing project authors may
; be found in the AUTHORS file in the root of the source tree.
;
EXPORT |vp8_fast_fdct4x4_armv6|
ARM
REQUIRE8
PRESERVE8
AREA |.text|, CODE, READONLY
; void vp8_short_fdct4x4_c(short *input, short *output, int pitch)
|vp8_fast_fdct4x4_armv6| PROC
stmfd sp!, {r4 - r12, lr}
; PART 1
; coeffs 0-3
ldrd r4, r5, [r0] ; [i1 | i0] [i3 | i2]
ldr r10, c7500
ldr r11, c14500
ldr r12, c0x22a453a0 ; [2217*4 | 5352*4]
ldr lr, c0x00080008
ror r5, r5, #16 ; [i2 | i3]
qadd16 r6, r4, r5 ; [i1+i2 | i0+i3] = [b1 | a1] without shift
qsub16 r7, r4, r5 ; [i1-i2 | i0-i3] = [c1 | d1] without shift
add r0, r0, r2 ; update input pointer
qadd16 r7, r7, r7 ; 2*[c1|d1] --> we can use smlad and smlsd
; with 2217*4 and 5352*4 without losing the
; sign bit (overflow)
smuad r4, r6, lr ; o0 = (i1+i2)*8 + (i0+i3)*8
smusd r5, r6, lr ; o2 = (i1+i2)*8 - (i0+i3)*8
smlad r6, r7, r12, r11 ; o1 = (c1 * 2217 + d1 * 5352 + 14500)
smlsdx r7, r7, r12, r10 ; o3 = (d1 * 2217 - c1 * 5352 + 7500)
ldrd r8, r9, [r0] ; [i5 | i4] [i7 | i6]
pkhbt r3, r4, r6, lsl #4 ; [o1 | o0], keep in register for PART 2
pkhbt r6, r5, r7, lsl #4 ; [o3 | o2]
str r6, [r1, #4]
; coeffs 4-7
ror r9, r9, #16 ; [i6 | i7]
qadd16 r6, r8, r9 ; [i5+i6 | i4+i7] = [b1 | a1] without shift
qsub16 r7, r8, r9 ; [i5-i6 | i4-i7] = [c1 | d1] without shift
add r0, r0, r2 ; update input pointer
qadd16 r7, r7, r7 ; 2x[c1|d1] --> we can use smlad and smlsd
; with 2217*4 and 5352*4 without losing the
; sign bit (overflow)
smuad r9, r6, lr ; o4 = (i5+i6)*8 + (i4+i7)*8
smusd r8, r6, lr ; o6 = (i5+i6)*8 - (i4+i7)*8
smlad r6, r7, r12, r11 ; o5 = (c1 * 2217 + d1 * 5352 + 14500)
smlsdx r7, r7, r12, r10 ; o7 = (d1 * 2217 - c1 * 5352 + 7500)
ldrd r4, r5, [r0] ; [i9 | i8] [i11 | i10]
pkhbt r9, r9, r6, lsl #4 ; [o5 | o4], keep in register for PART 2
pkhbt r6, r8, r7, lsl #4 ; [o7 | o6]
str r6, [r1, #12]
; coeffs 8-11
ror r5, r5, #16 ; [i10 | i11]
qadd16 r6, r4, r5 ; [i9+i10 | i8+i11]=[b1 | a1] without shift
qsub16 r7, r4, r5 ; [i9-i10 | i8-i11]=[c1 | d1] without shift
add r0, r0, r2 ; update input pointer
qadd16 r7, r7, r7 ; 2x[c1|d1] --> we can use smlad and smlsd
; with 2217*4 and 5352*4 without losing the
; sign bit (overflow)
smuad r2, r6, lr ; o8 = (i9+i10)*8 + (i8+i11)*8
smusd r8, r6, lr ; o10 = (i9+i10)*8 - (i8+i11)*8
smlad r6, r7, r12, r11 ; o9 = (c1 * 2217 + d1 * 5352 + 14500)
smlsdx r7, r7, r12, r10 ; o11 = (d1 * 2217 - c1 * 5352 + 7500)
ldrd r4, r5, [r0] ; [i13 | i12] [i15 | i14]
pkhbt r2, r2, r6, lsl #4 ; [o9 | o8], keep in register for PART 2
pkhbt r6, r8, r7, lsl #4 ; [o11 | o10]
str r6, [r1, #20]
; coeffs 12-15
ror r5, r5, #16 ; [i14 | i15]
qadd16 r6, r4, r5 ; [i13+i14 | i12+i15]=[b1|a1] without shift
qsub16 r7, r4, r5 ; [i13-i14 | i12-i15]=[c1|d1] without shift
qadd16 r7, r7, r7 ; 2x[c1|d1] --> we can use smlad and smlsd
; with 2217*4 and 5352*4 without losing the
; sign bit (overflow)
smuad r4, r6, lr ; o12 = (i13+i14)*8 + (i12+i15)*8
smusd r5, r6, lr ; o14 = (i13+i14)*8 - (i12+i15)*8
smlad r6, r7, r12, r11 ; o13 = (c1 * 2217 + d1 * 5352 + 14500)
smlsdx r7, r7, r12, r10 ; o15 = (d1 * 2217 - c1 * 5352 + 7500)
pkhbt r0, r4, r6, lsl #4 ; [o13 | o12], keep in register for PART 2
pkhbt r6, r5, r7, lsl #4 ; [o15 | o14]
str r6, [r1, #28]
; PART 2 -------------------------------------------------
ldr r11, c12000
ldr r10, c51000
ldr lr, c0x00070007
qadd16 r4, r3, r0 ; a1 = [i1+i13 | i0+i12]
qadd16 r5, r9, r2 ; b1 = [i5+i9 | i4+i8]
qsub16 r6, r9, r2 ; c1 = [i5-i9 | i4-i8]
qsub16 r7, r3, r0 ; d1 = [i1-i13 | i0-i12]
qadd16 r4, r4, lr ; a1 + 7
add r0, r11, #0x10000 ; add (d!=0)
qadd16 r2, r4, r5 ; a1 + b1 + 7
qsub16 r3, r4, r5 ; a1 - b1 + 7
ldr r12, c0x08a914e8 ; [2217 | 5352]
lsl r8, r2, #16 ; prepare bottom halfword for scaling
asr r2, r2, #4 ; scale top halfword
lsl r9, r3, #16 ; prepare bottom halfword for scaling
asr r3, r3, #4 ; scale top halfword
pkhtb r4, r2, r8, asr #20 ; pack and scale bottom halfword
pkhtb r5, r3, r9, asr #20 ; pack and scale bottom halfword
smulbt r2, r6, r12 ; [ ------ | c1*2217]
str r4, [r1, #0] ; [ o1 | o0]
smultt r3, r6, r12 ; [c1*2217 | ------ ]
str r5, [r1, #16] ; [ o9 | o8]
smlabb r8, r7, r12, r2 ; [ ------ | d1*5352]
smlatb r9, r7, r12, r3 ; [d1*5352 | ------ ]
smulbb r2, r6, r12 ; [ ------ | c1*5352]
smultb r3, r6, r12 ; [c1*5352 | ------ ]
lsls r6, r7, #16 ; d1 != 0 ?
addeq r8, r8, r11 ; c1_b*2217+d1_b*5352+12000 + (d==0)
addne r8, r8, r0 ; c1_b*2217+d1_b*5352+12000 + (d!=0)
asrs r6, r7, #16
addeq r9, r9, r11 ; c1_t*2217+d1_t*5352+12000 + (d==0)
addne r9, r9, r0 ; c1_t*2217+d1_t*5352+12000 + (d!=0)
smlabt r4, r7, r12, r10 ; [ ------ | d1*2217] + 51000
smlatt r5, r7, r12, r10 ; [d1*2217 | ------ ] + 51000
pkhtb r9, r9, r8, asr #16
sub r4, r4, r2
sub r5, r5, r3
ldr r3, [r1, #4] ; [i3 | i2]
pkhtb r5, r5, r4, asr #16 ; [o13|o12]
str r9, [r1, #8] ; [o5 | 04]
ldr r9, [r1, #12] ; [i7 | i6]
ldr r8, [r1, #28] ; [i15|i14]
ldr r2, [r1, #20] ; [i11|i10]
str r5, [r1, #24] ; [o13|o12]
qadd16 r4, r3, r8 ; a1 = [i3+i15 | i2+i14]
qadd16 r5, r9, r2 ; b1 = [i7+i11 | i6+i10]
qadd16 r4, r4, lr ; a1 + 7
qsub16 r6, r9, r2 ; c1 = [i7-i11 | i6-i10]
qadd16 r2, r4, r5 ; a1 + b1 + 7
qsub16 r7, r3, r8 ; d1 = [i3-i15 | i2-i14]
qsub16 r3, r4, r5 ; a1 - b1 + 7
lsl r8, r2, #16 ; prepare bottom halfword for scaling
asr r2, r2, #4 ; scale top halfword
lsl r9, r3, #16 ; prepare bottom halfword for scaling
asr r3, r3, #4 ; scale top halfword
pkhtb r4, r2, r8, asr #20 ; pack and scale bottom halfword
pkhtb r5, r3, r9, asr #20 ; pack and scale bottom halfword
smulbt r2, r6, r12 ; [ ------ | c1*2217]
str r4, [r1, #4] ; [ o3 | o2]
smultt r3, r6, r12 ; [c1*2217 | ------ ]
str r5, [r1, #20] ; [ o11 | o10]
smlabb r8, r7, r12, r2 ; [ ------ | d1*5352]
smlatb r9, r7, r12, r3 ; [d1*5352 | ------ ]
smulbb r2, r6, r12 ; [ ------ | c1*5352]
smultb r3, r6, r12 ; [c1*5352 | ------ ]
lsls r6, r7, #16 ; d1 != 0 ?
addeq r8, r8, r11 ; c1_b*2217+d1_b*5352+12000 + (d==0)
addne r8, r8, r0 ; c1_b*2217+d1_b*5352+12000 + (d!=0)
asrs r6, r7, #16
addeq r9, r9, r11 ; c1_t*2217+d1_t*5352+12000 + (d==0)
addne r9, r9, r0 ; c1_t*2217+d1_t*5352+12000 + (d!=0)
smlabt r4, r7, r12, r10 ; [ ------ | d1*2217] + 51000
smlatt r5, r7, r12, r10 ; [d1*2217 | ------ ] + 51000
pkhtb r9, r9, r8, asr #16
sub r4, r4, r2
sub r5, r5, r3
str r9, [r1, #12] ; [o7 | o6]
pkhtb r5, r5, r4, asr #16 ; [o15|o14]
str r5, [r1, #28] ; [o15|o14]
ldmfd sp!, {r4 - r12, pc}
ENDP
; Used constants
c7500
DCD 7500
c14500
DCD 14500
c0x22a453a0
DCD 0x22a453a0
c0x00080008
DCD 0x00080008
c12000
DCD 12000
c51000
DCD 51000
c0x00070007
DCD 0x00070007
c0x08a914e8
DCD 0x08a914e8
END

View File

@@ -0,0 +1,224 @@
;
; Copyright (c) 2011 The WebM project authors. All Rights Reserved.
;
; Use of this source code is governed by a BSD-style license
; that can be found in the LICENSE file in the root of the source
; tree. An additional intellectual property rights grant can be found
; in the file PATENTS. All contributing project authors may
; be found in the AUTHORS file in the root of the source tree.
;
EXPORT |vp8_fast_quantize_b_armv6|
INCLUDE asm_enc_offsets.asm
ARM
REQUIRE8
PRESERVE8
AREA ||.text||, CODE, READONLY, ALIGN=2
; r0 BLOCK *b
; r1 BLOCKD *d
|vp8_fast_quantize_b_armv6| PROC
stmfd sp!, {r1, r4-r11, lr}
ldr r3, [r0, #vp8_block_coeff] ; coeff
ldr r4, [r0, #vp8_block_quant_fast] ; quant_fast
ldr r5, [r0, #vp8_block_round] ; round
ldr r6, [r1, #vp8_blockd_qcoeff] ; qcoeff
ldr r7, [r1, #vp8_blockd_dqcoeff] ; dqcoeff
ldr r8, [r1, #vp8_blockd_dequant] ; dequant
ldr r2, loop_count ; loop_count=0x1000000. 'lsls' instruction
; is used to update the counter so that
; it can be used to mark nonzero
; quantized coefficient pairs.
mov r1, #0 ; flags for quantized coeffs
; PART 1: quantization and dequantization loop
loop
ldr r9, [r3], #4 ; [z1 | z0]
ldr r10, [r5], #4 ; [r1 | r0]
ldr r11, [r4], #4 ; [q1 | q0]
ssat16 lr, #1, r9 ; [sz1 | sz0]
eor r9, r9, lr ; [z1 ^ sz1 | z0 ^ sz0]
ssub16 r9, r9, lr ; x = (z ^ sz) - sz
sadd16 r9, r9, r10 ; [x1+r1 | x0+r0]
ldr r12, [r3], #4 ; [z3 | z2]
smulbb r0, r9, r11 ; [(x0+r0)*q0]
smultt r9, r9, r11 ; [(x1+r1)*q1]
ldr r10, [r5], #4 ; [r3 | r2]
ssat16 r11, #1, r12 ; [sz3 | sz2]
eor r12, r12, r11 ; [z3 ^ sz3 | z2 ^ sz2]
pkhtb r0, r9, r0, asr #16 ; [y1 | y0]
ldr r9, [r4], #4 ; [q3 | q2]
ssub16 r12, r12, r11 ; x = (z ^ sz) - sz
sadd16 r12, r12, r10 ; [x3+r3 | x2+r2]
eor r0, r0, lr ; [(y1 ^ sz1) | (y0 ^ sz0)]
smulbb r10, r12, r9 ; [(x2+r2)*q2]
smultt r12, r12, r9 ; [(x3+r3)*q3]
ssub16 r0, r0, lr ; x = (y ^ sz) - sz
cmp r0, #0 ; check if zero
orrne r1, r1, r2, lsr #24 ; add flag for nonzero coeffs
str r0, [r6], #4 ; *qcoeff++ = x
ldr r9, [r8], #4 ; [dq1 | dq0]
pkhtb r10, r12, r10, asr #16 ; [y3 | y2]
eor r10, r10, r11 ; [(y3 ^ sz3) | (y2 ^ sz2)]
ssub16 r10, r10, r11 ; x = (y ^ sz) - sz
cmp r10, #0 ; check if zero
orrne r1, r1, r2, lsr #23 ; add flag for nonzero coeffs
str r10, [r6], #4 ; *qcoeff++ = x
ldr r11, [r8], #4 ; [dq3 | dq2]
smulbb r12, r0, r9 ; [x0*dq0]
smultt r0, r0, r9 ; [x1*dq1]
smulbb r9, r10, r11 ; [x2*dq2]
smultt r10, r10, r11 ; [x3*dq3]
lsls r2, r2, #2 ; update loop counter
strh r12, [r7, #0] ; dqcoeff[0] = [x0*dq0]
strh r0, [r7, #2] ; dqcoeff[1] = [x1*dq1]
strh r9, [r7, #4] ; dqcoeff[2] = [x2*dq2]
strh r10, [r7, #6] ; dqcoeff[3] = [x3*dq3]
add r7, r7, #8 ; dqcoeff += 8
bne loop
; PART 2: check position for eob...
mov lr, #0 ; init eob
cmp r1, #0 ; coeffs after quantization?
ldr r11, [sp, #0] ; restore BLOCKD pointer
beq end ; skip eob calculations if all zero
ldr r0, [r11, #vp8_blockd_qcoeff]
; check shortcut for nonzero qcoeffs
tst r1, #0x80
bne quant_coeff_15_14
tst r1, #0x20
bne quant_coeff_13_11
tst r1, #0x8
bne quant_coeff_12_7
tst r1, #0x40
bne quant_coeff_10_9
tst r1, #0x10
bne quant_coeff_8_3
tst r1, #0x2
bne quant_coeff_6_5
tst r1, #0x4
bne quant_coeff_4_2
b quant_coeff_1_0
quant_coeff_15_14
ldrh r2, [r0, #30] ; rc=15, i=15
mov lr, #16
cmp r2, #0
bne end
ldrh r3, [r0, #28] ; rc=14, i=14
mov lr, #15
cmp r3, #0
bne end
quant_coeff_13_11
ldrh r2, [r0, #22] ; rc=11, i=13
mov lr, #14
cmp r2, #0
bne end
quant_coeff_12_7
ldrh r3, [r0, #14] ; rc=7, i=12
mov lr, #13
cmp r3, #0
bne end
ldrh r2, [r0, #20] ; rc=10, i=11
mov lr, #12
cmp r2, #0
bne end
quant_coeff_10_9
ldrh r3, [r0, #26] ; rc=13, i=10
mov lr, #11
cmp r3, #0
bne end
ldrh r2, [r0, #24] ; rc=12, i=9
mov lr, #10
cmp r2, #0
bne end
quant_coeff_8_3
ldrh r3, [r0, #18] ; rc=9, i=8
mov lr, #9
cmp r3, #0
bne end
ldrh r2, [r0, #12] ; rc=6, i=7
mov lr, #8
cmp r2, #0
bne end
quant_coeff_6_5
ldrh r3, [r0, #6] ; rc=3, i=6
mov lr, #7
cmp r3, #0
bne end
ldrh r2, [r0, #4] ; rc=2, i=5
mov lr, #6
cmp r2, #0
bne end
quant_coeff_4_2
ldrh r3, [r0, #10] ; rc=5, i=4
mov lr, #5
cmp r3, #0
bne end
ldrh r2, [r0, #16] ; rc=8, i=3
mov lr, #4
cmp r2, #0
bne end
ldrh r3, [r0, #8] ; rc=4, i=2
mov lr, #3
cmp r3, #0
bne end
quant_coeff_1_0
ldrh r2, [r0, #2] ; rc=1, i=1
mov lr, #2
cmp r2, #0
bne end
mov lr, #1 ; rc=0, i=0
end
str lr, [r11, #vp8_blockd_eob]
ldmfd sp!, {r1, r4-r11, pc}
ENDP
loop_count
DCD 0x1000000
END

View File

@@ -0,0 +1,133 @@
;
; Copyright (c) 2011 The WebM project authors. All Rights Reserved.
;
; Use of this source code is governed by a BSD-style license
; that can be found in the LICENSE file in the root of the source
; tree. An additional intellectual property rights grant can be found
; in the file PATENTS. All contributing project authors may
; be found in the AUTHORS file in the root of the source tree.
;
EXPORT |vp8_mse16x16_armv6|
ARM
AREA ||.text||, CODE, READONLY, ALIGN=2
; r0 unsigned char *src_ptr
; r1 int source_stride
; r2 unsigned char *ref_ptr
; r3 int recon_stride
; stack unsigned int *sse
;
;note: Based on vp8_variance16x16_armv6. In this function, sum is never used.
; So, we can remove this part of calculation.
|vp8_mse16x16_armv6| PROC
push {r4-r9, lr}
mov r12, #16 ; set loop counter to 16 (=block height)
mov r4, #0 ; initialize sse = 0
loop
; 1st 4 pixels
ldr r5, [r0, #0x0] ; load 4 src pixels
ldr r6, [r2, #0x0] ; load 4 ref pixels
mov lr, #0 ; constant zero
usub8 r8, r5, r6 ; calculate difference
sel r7, r8, lr ; select bytes with positive difference
usub8 r9, r6, r5 ; calculate difference with reversed operands
sel r8, r9, lr ; select bytes with negative difference
; calculate partial sums
usad8 r5, r7, lr ; calculate sum of positive differences
usad8 r6, r8, lr ; calculate sum of negative differences
orr r8, r8, r7 ; differences of all 4 pixels
ldr r5, [r0, #0x4] ; load 4 src pixels
; calculate sse
uxtb16 r6, r8 ; byte (two pixels) to halfwords
uxtb16 r7, r8, ror #8 ; another two pixels to halfwords
smlad r4, r6, r6, r4 ; dual signed multiply, add and accumulate (1)
; 2nd 4 pixels
ldr r6, [r2, #0x4] ; load 4 ref pixels
smlad r4, r7, r7, r4 ; dual signed multiply, add and accumulate (2)
usub8 r8, r5, r6 ; calculate difference
sel r7, r8, lr ; select bytes with positive difference
usub8 r9, r6, r5 ; calculate difference with reversed operands
sel r8, r9, lr ; select bytes with negative difference
; calculate partial sums
usad8 r5, r7, lr ; calculate sum of positive differences
usad8 r6, r8, lr ; calculate sum of negative differences
orr r8, r8, r7 ; differences of all 4 pixels
ldr r5, [r0, #0x8] ; load 4 src pixels
; calculate sse
uxtb16 r6, r8 ; byte (two pixels) to halfwords
uxtb16 r7, r8, ror #8 ; another two pixels to halfwords
smlad r4, r6, r6, r4 ; dual signed multiply, add and accumulate (1)
; 3rd 4 pixels
ldr r6, [r2, #0x8] ; load 4 ref pixels
smlad r4, r7, r7, r4 ; dual signed multiply, add and accumulate (2)
usub8 r8, r5, r6 ; calculate difference
sel r7, r8, lr ; select bytes with positive difference
usub8 r9, r6, r5 ; calculate difference with reversed operands
sel r8, r9, lr ; select bytes with negative difference
; calculate partial sums
usad8 r5, r7, lr ; calculate sum of positive differences
usad8 r6, r8, lr ; calculate sum of negative differences
orr r8, r8, r7 ; differences of all 4 pixels
ldr r5, [r0, #0xc] ; load 4 src pixels
; calculate sse
uxtb16 r6, r8 ; byte (two pixels) to halfwords
uxtb16 r7, r8, ror #8 ; another two pixels to halfwords
smlad r4, r6, r6, r4 ; dual signed multiply, add and accumulate (1)
; 4th 4 pixels
ldr r6, [r2, #0xc] ; load 4 ref pixels
smlad r4, r7, r7, r4 ; dual signed multiply, add and accumulate (2)
usub8 r8, r5, r6 ; calculate difference
add r0, r0, r1 ; set src_ptr to next row
sel r7, r8, lr ; select bytes with positive difference
usub8 r9, r6, r5 ; calculate difference with reversed operands
add r2, r2, r3 ; set dst_ptr to next row
sel r8, r9, lr ; select bytes with negative difference
; calculate partial sums
usad8 r5, r7, lr ; calculate sum of positive differences
usad8 r6, r8, lr ; calculate sum of negative differences
orr r8, r8, r7 ; differences of all 4 pixels
subs r12, r12, #1 ; next row
; calculate sse
uxtb16 r6, r8 ; byte (two pixels) to halfwords
uxtb16 r7, r8, ror #8 ; another two pixels to halfwords
smlad r4, r6, r6, r4 ; dual signed multiply, add and accumulate (1)
smlad r4, r7, r7, r4 ; dual signed multiply, add and accumulate (2)
bne loop
; return stuff
ldr r1, [sp, #28] ; get address of sse
mov r0, r4 ; return sse
str r4, [r1] ; store sse
pop {r4-r9, pc}
ENDP
END

View File

@@ -0,0 +1,84 @@
;
; Copyright (c) 2011 The WebM project authors. All Rights Reserved.
;
; Use of this source code is governed by a BSD-style license
; that can be found in the LICENSE file in the root of the source
; tree. An additional intellectual property rights grant can be found
; in the file PATENTS. All contributing project authors may
; be found in the AUTHORS file in the root of the source tree.
;
EXPORT |vp8_sad16x16_armv6|
ARM
REQUIRE8
PRESERVE8
AREA ||.text||, CODE, READONLY, ALIGN=2
; r0 const unsigned char *src_ptr
; r1 int src_stride
; r2 const unsigned char *ref_ptr
; r3 int ref_stride
; stack max_sad (not used)
|vp8_sad16x16_armv6| PROC
stmfd sp!, {r4-r12, lr}
mov r4, #0 ; sad = 0;
mov r5, #8 ; loop count
loop
; 1st row
ldr r6, [r0, #0x0] ; load 4 src pixels (1A)
ldr r8, [r2, #0x0] ; load 4 ref pixels (1A)
ldr r7, [r0, #0x4] ; load 4 src pixels (1A)
ldr r9, [r2, #0x4] ; load 4 ref pixels (1A)
ldr r10, [r0, #0x8] ; load 4 src pixels (1B)
ldr r11, [r0, #0xC] ; load 4 src pixels (1B)
usada8 r4, r8, r6, r4 ; calculate sad for 4 pixels
usad8 r8, r7, r9 ; calculate sad for 4 pixels
ldr r12, [r2, #0x8] ; load 4 ref pixels (1B)
ldr lr, [r2, #0xC] ; load 4 ref pixels (1B)
add r0, r0, r1 ; set src pointer to next row
add r2, r2, r3 ; set dst pointer to next row
usada8 r4, r10, r12, r4 ; calculate sad for 4 pixels
usada8 r8, r11, lr, r8 ; calculate sad for 4 pixels
ldr r6, [r0, #0x0] ; load 4 src pixels (2A)
ldr r7, [r0, #0x4] ; load 4 src pixels (2A)
add r4, r4, r8 ; add partial sad values
; 2nd row
ldr r8, [r2, #0x0] ; load 4 ref pixels (2A)
ldr r9, [r2, #0x4] ; load 4 ref pixels (2A)
ldr r10, [r0, #0x8] ; load 4 src pixels (2B)
ldr r11, [r0, #0xC] ; load 4 src pixels (2B)
usada8 r4, r6, r8, r4 ; calculate sad for 4 pixels
usad8 r8, r7, r9 ; calculate sad for 4 pixels
ldr r12, [r2, #0x8] ; load 4 ref pixels (2B)
ldr lr, [r2, #0xC] ; load 4 ref pixels (2B)
add r0, r0, r1 ; set src pointer to next row
add r2, r2, r3 ; set dst pointer to next row
usada8 r4, r10, r12, r4 ; calculate sad for 4 pixels
usada8 r8, r11, lr, r8 ; calculate sad for 4 pixels
subs r5, r5, #1 ; decrement loop counter
add r4, r4, r8 ; add partial sad values
bne loop
mov r0, r4 ; return sad
ldmfd sp!, {r4-r12, pc}
ENDP
END

View File

@@ -0,0 +1,95 @@
;
; Copyright (c) 2011 The WebM project authors. All Rights Reserved.
;
; Use of this source code is governed by a BSD-style license
; that can be found in the LICENSE file in the root of the source
; tree. An additional intellectual property rights grant can be found
; in the file PATENTS. All contributing project authors may
; be found in the AUTHORS file in the root of the source tree.
;
EXPORT |vp8_variance8x8_armv6|
ARM
AREA ||.text||, CODE, READONLY, ALIGN=2
; r0 unsigned char *src_ptr
; r1 int source_stride
; r2 unsigned char *ref_ptr
; r3 int recon_stride
; stack unsigned int *sse
|vp8_variance8x8_armv6| PROC
push {r4-r10, lr}
mov r12, #8 ; set loop counter to 8 (=block height)
mov r4, #0 ; initialize sum = 0
mov r5, #0 ; initialize sse = 0
loop
; 1st 4 pixels
ldr r6, [r0, #0x0] ; load 4 src pixels
ldr r7, [r2, #0x0] ; load 4 ref pixels
mov lr, #0 ; constant zero
usub8 r8, r6, r7 ; calculate difference
sel r10, r8, lr ; select bytes with positive difference
usub8 r9, r7, r6 ; calculate difference with reversed operands
sel r8, r9, lr ; select bytes with negative difference
; calculate partial sums
usad8 r6, r10, lr ; calculate sum of positive differences
usad8 r7, r8, lr ; calculate sum of negative differences
orr r8, r8, r10 ; differences of all 4 pixels
; calculate total sum
add r4, r4, r6 ; add positive differences to sum
sub r4, r4, r7 ; substract negative differences from sum
; calculate sse
uxtb16 r7, r8 ; byte (two pixels) to halfwords
uxtb16 r10, r8, ror #8 ; another two pixels to halfwords
smlad r5, r7, r7, r5 ; dual signed multiply, add and accumulate (1)
; 2nd 4 pixels
ldr r6, [r0, #0x4] ; load 4 src pixels
ldr r7, [r2, #0x4] ; load 4 ref pixels
smlad r5, r10, r10, r5 ; dual signed multiply, add and accumulate (2)
usub8 r8, r6, r7 ; calculate difference
add r0, r0, r1 ; set src_ptr to next row
sel r10, r8, lr ; select bytes with positive difference
usub8 r9, r7, r6 ; calculate difference with reversed operands
add r2, r2, r3 ; set dst_ptr to next row
sel r8, r9, lr ; select bytes with negative difference
; calculate partial sums
usad8 r6, r10, lr ; calculate sum of positive differences
usad8 r7, r8, lr ; calculate sum of negative differences
orr r8, r8, r10 ; differences of all 4 pixels
; calculate total sum
add r4, r4, r6 ; add positive differences to sum
sub r4, r4, r7 ; substract negative differences from sum
; calculate sse
uxtb16 r7, r8 ; byte (two pixels) to halfwords
uxtb16 r10, r8, ror #8 ; another two pixels to halfwords
smlad r5, r7, r7, r5 ; dual signed multiply, add and accumulate (1)
subs r12, r12, #1 ; next row
smlad r5, r10, r10, r5 ; dual signed multiply, add and accumulate (2)
bne loop
; return stuff
ldr r8, [sp, #32] ; get address of sse
mul r1, r4, r4 ; sum * sum
str r5, [r8] ; store sse
sub r0, r5, r1, ASR #6 ; return (sse - ((sum * sum) >> 6))
pop {r4-r10, pc}
ENDP
END

View File

@@ -9,8 +9,8 @@
*/
#include "boolhuff.h"
#include "blockd.h"
#include "vp8/encoder/boolhuff.h"
#include "vp8/common/blockd.h"
const unsigned int vp8_prob_cost[256] =
{

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
* Copyright (c) 2011 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@@ -8,24 +8,17 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "vpx_config.h"
#include "vp8/encoder/dct.h"
#if !defined(_mac_specs_h)
#define _mac_specs_h
#if HAVE_ARMV6
#if defined(__cplusplus)
extern "C" {
#endif
extern unsigned int vp8_read_tsc();
extern unsigned int vp8_get_processor_freq();
extern unsigned int vpx_has_altivec();
#if defined(__cplusplus)
void vp8_fast_fdct8x4_armv6(short *input, short *output, int pitch)
{
vp8_fast_fdct4x4_armv6(input, output, pitch);
vp8_fast_fdct4x4_armv6(input + 4, output + 16, pitch);
}
#endif
#endif /* HAVE_ARMV6 */
#endif

View File

@@ -14,12 +14,21 @@
#if HAVE_ARMV6
extern prototype_fdct(vp8_short_walsh4x4_armv6);
extern prototype_fdct(vp8_fast_fdct4x4_armv6);
extern prototype_fdct(vp8_fast_fdct8x4_armv6);
#if !CONFIG_RUNTIME_CPU_DETECT
#undef vp8_fdct_walsh_short4x4
#define vp8_fdct_walsh_short4x4 vp8_short_walsh4x4_armv6
#undef vp8_fdct_fast4x4
#define vp8_fdct_fast4x4 vp8_fast_fdct4x4_armv6
#undef vp8_fdct_fast8x4
#define vp8_fdct_fast8x4 vp8_fast_fdct8x4_armv6
#endif
#endif
#endif /* HAVE_ARMV6 */
#if HAVE_ARMV7
extern prototype_fdct(vp8_short_fdct4x4_neon);

View File

@@ -9,13 +9,13 @@
*/
#include "encodemb.h"
#include "reconinter.h"
#include "quantize.h"
#include "invtrans.h"
#include "recon.h"
#include "reconintra.h"
#include "dct.h"
#include "vp8/encoder/encodemb.h"
#include "vp8/common/reconinter.h"
#include "vp8/encoder/quantize.h"
#include "vp8/common/invtrans.h"
#include "vp8/common/recon.h"
#include "vp8/common/reconintra.h"
#include "vp8/encoder/dct.h"
#include "vpx_mem/vpx_mem.h"
extern void vp8_subtract_b_neon_func(short *diff, unsigned char *src, unsigned char *pred, int stride, int pitch);

View File

@@ -9,13 +9,13 @@
*/
#include "onyxc_int.h"
#include "onyx_int.h"
#include "quantize.h"
#include "vp8/common/onyxc_int.h"
#include "vp8/encoder/onyx_int.h"
#include "vp8/encoder/quantize.h"
#include "vpx_mem/vpx_mem.h"
#include "vpx_scale/yv12extend.h"
#include "vpx_scale/vpxscale.h"
#include "alloccommon.h"
#include "vp8/common/alloccommon.h"
extern void vp8_memcpy_neon(unsigned char *dst_ptr, unsigned char *src_ptr, int sz);

View File

@@ -12,9 +12,8 @@
#include <math.h>
#include "vpx_mem/vpx_mem.h"
#include "quantize.h"
#include "entropy.h"
#include "predictdc.h"
#include "vp8/encoder/quantize.h"
#include "vp8/common/entropy.h"
DECLARE_ALIGNED(16, const short, vp8_rvsplus1_default_zig_zag1d[16]) =
{

View File

@@ -12,6 +12,16 @@
#ifndef QUANTIZE_ARM_H
#define QUANTIZE_ARM_H
#if HAVE_ARMV6
extern prototype_quantize_block(vp8_fast_quantize_b_armv6);
#undef vp8_quantize_fastquantb
#define vp8_quantize_fastquantb vp8_fast_quantize_b_armv6
#endif /* HAVE_ARMV6 */
#if HAVE_ARMV7
extern prototype_quantize_block(vp8_fast_quantize_b_neon);

View File

@@ -9,12 +9,40 @@
*/
#include "vpx_config.h"
#include "variance.h"
#include "filter.h"
#include "arm/bilinearfilter_arm.h"
#include "vp8/encoder/variance.h"
#include "vp8/common/filter.h"
#include "vp8/common/arm/bilinearfilter_arm.h"
#if HAVE_ARMV6
unsigned int vp8_sub_pixel_variance8x8_armv6
(
const unsigned char *src_ptr,
int src_pixels_per_line,
int xoffset,
int yoffset,
const unsigned char *dst_ptr,
int dst_pixels_per_line,
unsigned int *sse
)
{
unsigned short first_pass[10*8];
unsigned char second_pass[8*8];
const short *HFilter, *VFilter;
HFilter = vp8_bilinear_filters[xoffset];
VFilter = vp8_bilinear_filters[yoffset];
vp8_filter_block2d_bil_first_pass_armv6(src_ptr, first_pass,
src_pixels_per_line,
9, 8, HFilter);
vp8_filter_block2d_bil_second_pass_armv6(first_pass, second_pass,
8, 8, 8, VFilter);
return vp8_variance8x8_armv6(second_pass, 8, dst_ptr,
dst_pixels_per_line, sse);
}
unsigned int vp8_sub_pixel_variance16x16_armv6
(
const unsigned char *src_ptr,
@@ -43,7 +71,41 @@ unsigned int vp8_sub_pixel_variance16x16_armv6
dst_pixels_per_line, sse);
}
#endif
unsigned int vp8_variance_halfpixvar16x16_h_armv6(
const unsigned char *src_ptr,
int source_stride,
const unsigned char *ref_ptr,
int recon_stride,
unsigned int *sse)
{
return vp8_sub_pixel_variance16x16_armv6(src_ptr, source_stride, 4, 0,
ref_ptr, recon_stride, sse);
}
unsigned int vp8_variance_halfpixvar16x16_v_armv6(
const unsigned char *src_ptr,
int source_stride,
const unsigned char *ref_ptr,
int recon_stride,
unsigned int *sse)
{
return vp8_sub_pixel_variance16x16_armv6(src_ptr, source_stride, 0, 4,
ref_ptr, recon_stride, sse);
}
unsigned int vp8_variance_halfpixvar16x16_hv_armv6(
const unsigned char *src_ptr,
int source_stride,
const unsigned char *ref_ptr,
int recon_stride,
unsigned int *sse)
{
return vp8_sub_pixel_variance16x16_armv6(src_ptr, source_stride, 4, 4,
ref_ptr, recon_stride, sse);
}
#endif /* HAVE_ARMV6 */
#if HAVE_ARMV7

View File

@@ -14,21 +14,50 @@
#if HAVE_ARMV6
extern prototype_sad(vp8_sad16x16_armv6);
extern prototype_variance(vp8_variance16x16_armv6);
extern prototype_variance(vp8_variance8x8_armv6);
extern prototype_subpixvariance(vp8_sub_pixel_variance16x16_armv6);
extern prototype_subpixvariance(vp8_sub_pixel_variance8x8_armv6);
extern prototype_variance(vp8_variance_halfpixvar16x16_h_armv6);
extern prototype_variance(vp8_variance_halfpixvar16x16_v_armv6);
extern prototype_variance(vp8_variance_halfpixvar16x16_hv_armv6);
extern prototype_variance(vp8_mse16x16_armv6);
#if !CONFIG_RUNTIME_CPU_DETECT
#undef vp8_variance_sad16x16
#define vp8_variance_sad16x16 vp8_sad16x16_armv6
#undef vp8_variance_subpixvar16x16
#define vp8_variance_subpixvar16x16 vp8_sub_pixel_variance16x16_armv6
#undef vp8_variance_subpixvar8x8
#define vp8_variance_subpixvar8x8 vp8_sub_pixel_variance8x8_armv6
#undef vp8_variance_var16x16
#define vp8_variance_var16x16 vp8_variance16x16_armv6
#undef vp8_variance_mse16x16
#define vp8_variance_mse16x16 vp8_mse16x16_armv6
#undef vp8_variance_var8x8
#define vp8_variance_var8x8 vp8_variance8x8_armv6
#undef vp8_variance_halfpixvar16x16_h
#define vp8_variance_halfpixvar16x16_h vp8_variance_halfpixvar16x16_h_armv6
#undef vp8_variance_halfpixvar16x16_v
#define vp8_variance_halfpixvar16x16_v vp8_variance_halfpixvar16x16_v_armv6
#undef vp8_variance_halfpixvar16x16_hv
#define vp8_variance_halfpixvar16x16_hv vp8_variance_halfpixvar16x16_hv_armv6
#endif /* !CONFIG_RUNTIME_CPU_DETECT */
#endif /* HAVE_ARMV6 */
#if HAVE_ARMV7
extern prototype_sad(vp8_sad4x4_neon);
extern prototype_sad(vp8_sad8x8_neon);

View File

@@ -65,6 +65,17 @@ DEFINE(TOKENLIST_SZ, sizeof(TOKENLIST));
DEFINE(vp8_common_mb_rows, offsetof(VP8_COMMON, mb_rows));
// offsets from BLOCK structure
DEFINE(vp8_block_coeff, offsetof(BLOCK, coeff));
DEFINE(vp8_block_quant_fast, offsetof(BLOCK, quant_fast));
DEFINE(vp8_block_round, offsetof(BLOCK, round));
// offsets from BLOCKD structure
DEFINE(vp8_blockd_qcoeff, offsetof(BLOCKD, qcoeff));
DEFINE(vp8_blockd_dqcoeff, offsetof(BLOCKD, dqcoeff));
DEFINE(vp8_blockd_dequant, offsetof(BLOCKD, dequant));
DEFINE(vp8_blockd_eob, offsetof(BLOCKD, eob));
// These two sizes are used in vp8cx_pack_tokens. They are hard coded
// so if the size changes this will have to be adjusted.
#if HAVE_ARMV5TE

View File

@@ -9,15 +9,15 @@
*/
#include "header.h"
#include "vp8/common/header.h"
#include "encodemv.h"
#include "entropymode.h"
#include "findnearmv.h"
#include "vp8/common/entropymode.h"
#include "vp8/common/findnearmv.h"
#include "mcomp.h"
#include "systemdependent.h"
#include "vp8/common/systemdependent.h"
#include <assert.h>
#include <stdio.h>
#include "pragmas.h"
#include "vp8/common/pragmas.h"
#include "vpx_mem/vpx_mem.h"
#include "bitstream.h"
@@ -58,16 +58,6 @@ extern unsigned int active_section;
int count_mb_seg[4] = { 0, 0, 0, 0 };
#endif
#if CONFIG_BIG_ENDIAN
# define make_endian_16(a) \
(((unsigned int)(a & 0xff)) << 8) | (((unsigned int)(a & 0xff00)) >> 8)
# define make_endian_32(a) \
(((unsigned int)(a & 0xff)) << 24) | (((unsigned int)(a & 0xff00)) << 8) | \
(((unsigned int)(a & 0xff0000)) >> 8) | (((unsigned int)(a & 0xff000000)) >> 24)
#else
# define make_endian_16(a) a
# define make_endian_32(a) a
#endif
static void update_mode(
vp8_writer *const w,
@@ -1376,6 +1366,7 @@ void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned long *size)
oh.show_frame = (int) pc->show_frame;
oh.type = (int)pc->frame_type;
oh.version = pc->version;
oh.first_partition_length_in_bytes = 0;
mb_feature_data_bits = vp8_mb_feature_data_bits;
cx_data += 3;
@@ -1392,13 +1383,20 @@ void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned long *size)
// every keyframe send startcode, width, height, scale factor, clamp and color type
if (oh.type == KEY_FRAME)
{
int v;
// Start / synch code
cx_data[0] = 0x9D;
cx_data[1] = 0x01;
cx_data[2] = 0x2a;
*((unsigned short *)(cx_data + 3)) = make_endian_16((pc->horiz_scale << 14) | pc->Width);
*((unsigned short *)(cx_data + 5)) = make_endian_16((pc->vert_scale << 14) | pc->Height);
v = (pc->horiz_scale << 14) | pc->Width;
cx_data[3] = v;
cx_data[4] = v >> 8;
v = (pc->vert_scale << 14) | pc->Height;
cx_data[5] = v;
cx_data[6] = v >> 8;
extra_bytes_packed = 7;
cx_data += extra_bytes_packed ;
@@ -1637,6 +1635,21 @@ void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned long *size)
vp8_stop_encode(bc);
oh.first_partition_length_in_bytes = cpi->bc.pos;
/* update frame tag */
{
int v = (oh.first_partition_length_in_bytes << 5) |
(oh.show_frame << 4) |
(oh.version << 1) |
oh.type;
dest[0] = v;
dest[1] = v >> 8;
dest[2] = v >> 16;
}
*size = VP8_HEADER_SIZE + extra_bytes_packed + cpi->bc.pos;
if (pc->multi_token_partition != ONE_PARTITION)
{
@@ -1646,9 +1659,7 @@ void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned long *size)
pack_tokens_into_partitions(cpi, cx_data + bc->pos, num_part, &asize);
oh.first_partition_length_in_bytes = cpi->bc.pos;
*size = cpi->bc.pos + VP8_HEADER_SIZE + asize + extra_bytes_packed;
*size += asize;
}
else
{
@@ -1662,23 +1673,9 @@ void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned long *size)
pack_tokens(&cpi->bc2, cpi->tok, cpi->tok_count);
vp8_stop_encode(&cpi->bc2);
oh.first_partition_length_in_bytes = cpi->bc.pos ;
*size = cpi->bc2.pos + cpi->bc.pos + VP8_HEADER_SIZE + extra_bytes_packed;
}
#if CONFIG_BIG_ENDIAN
{
int v = (oh.first_partition_length_in_bytes << 5) |
(oh.show_frame << 4) |
(oh.version << 1) |
oh.type;
v = make_endian_32(v);
vpx_memcpy(dest, &v, 3);
*size += cpi->bc2.pos;
}
#else
vpx_memcpy(dest, &oh, 3);
#endif
}
#ifdef ENTROPY_STATS

Some files were not shown because too many files have changed in this diff Show More