Commit Graph

102 Commits

Author SHA1 Message Date
Yaowu Xu
bba710fcbd added transform type to MB_MODE_INFO
this commit is to add an variable in the macroblock level mode
info structure to track the transform size used in each MB, so
the information can be used later in the loop filter to change
how loop filter works on MBs with different transform sizes.

Change-Id: Id0eeaba6cc854c6d1be00ed8d237b3d9e250e447
2011-12-01 07:34:27 -08:00
Paul Wilkins
3cdfdb55e4 Merge CONFIGURE_SEGMENTATION experiment.
Removal of CONFIGURE_SEGMENTATION ifdefs.

Removal of legacy support code fo the old coding mechanism.

Use local reference "xd" for MACROBLOCKD structure in
encode_frame_to_data_rate()

Moved call to choose_segmap_coding_method() out of encode
loop as the cost of segmentation is not properly accounted
in the loop anyway. If this is desirable in the future it
can be moved back. The use of this function to do all the
analysis and set the probabilities also removes the need
to track segment useage in threading code.

Change-Id: I85bc8fd63440e7176c73d26cb742698f9b70cade
2011-11-15 16:15:23 +00:00
Paul Wilkins
661b2c2dcf Further work on Segmentation Experiment:
This check in includes quite a lot of clean up and refactoring.

Most of the analysis and set up for the different coding options for the
segment map (currently simple distribution based coding or temporaly
predicted coding), has been moved to one location (the function
choose_segmap_coding_method() in segmenation.c). This code was previously
scattered around in various locations making integration with other
experiments and modification / debug more difficult.

Currently the functionality is as it was with the exception that the
prediction probabilities are now only transmitted when the temporal
prediction mode is selected.

There is still quite a bit more clean up work that will be possible
when the #ifdef is removed. Also at that time I may rename and alter
the sense of macroblock based variable "segment_flag" which indicates
(1 that the segmnet id is not predicted vs 0 that it is predicted).

I also intend to experiment with a spatial prediction mode that can be
used when coding a key frame segment map or in cases where temporal
prediction does not work well but there is spatial correlation.

In a later check in when the ifdefs have gone I may also move the call
to choose_segmap_coding_method() to just before where the bitsream is
packed (currently it is in vp8_encode_frame()) to further reduce the
possibility of clashes with other experiments and prevent it being called
on each itteration of the recode loop.

Change-Id: I3d4aba2a2826ec21f367678d5b07c1d1c36db168
2011-11-15 11:13:33 +00:00
Paul Wilkins
bf25d4ad7f SEGMENTATION experiment:
Some initial cleanup to aid testing and debug.

Pull code to choose temporal or spatial encoding
out of encodeframe.c into a dedicated function
in segmentation.c.

For now disable broken temporal mode.

Move the coding of "temporal_update" flag and
only transmit if segment map update is indicated.

Rename the functions read_mb_features() and
write_mb_features() to read_mb_segid() and
read_mb_segid() as they only read and write
the macroblock segment id not any of the
features.

Change-Id: Ib75118520b1144c24d35fdfc6ce46106803cabcf
2011-11-11 18:31:21 +00:00
Yaowu Xu
e01b39254b changed function name for clarity
The dequantizer functions for 2nd order haar block had confusing 8x8
in their names. this commit fixed their name to avoid confusion.

Change-Id: I6ae4e7888330865f831436313637d4395b1fc273
2011-11-11 09:01:16 -08:00
Yaowu Xu
7189198d53 fixed the decoder when using 8x8 transform
updated the decode_macroblock logic to reflect that 8x8 transform is
not used for "SPLITMV". Also fixed an issue where 2nd order haar block
has wrong dequant/idct process.

Change-Id: I1e373f6535c009dfec503b6362c8a5cfc196e1da
2011-11-10 17:15:06 -08:00
Paul Wilkins
a9df4183a6 Segment signaling of TX size
Initial attempt at using new segment feature signaling
to indicate 4x4 or 8x8 transform.

needs --enable-experimental --enable-t8x8

Note this is work in progress.

Change-Id: Ib160d46a5d810307bfcbc79853ce1a65b5b870b7
2011-11-08 12:21:08 +00:00
Paul Wilkins
a258bba1fb Segment Feature Data Access
No change to functionality or output.

Updates to the segment feature data structure now all done
through functions such as set_segdata() and get_segdata()
in seg_common.c.

The reason for this is to make changing the structures (if needed)
and debug easier.

In addition it provides a single location for subsequent addition
of range and validity checks. For  example valid combination of
mode and reference frame.

Change-Id: I2e866505562db4e4cb6f17a472b25b4465f01add
2011-11-04 10:42:12 +00:00
Paul Wilkins
a10a268e58 Segment Features. Removal of #ifdefs
Removal of configure #ifdefs so that segment features
always available. Removal of code supporting old
segment feature method.

Still a good deal of tidying up to do.

Change-Id: I397855f086f8c09ab1fae0a5f65d9e06d2e3e39f
2011-11-03 17:14:26 +00:00
Paul Wilkins
87ff8620b2 Segmentation: Reference frames
Modify reference frame segmentation so that ONE or MORE
reference frames may be marked as a available for a given
segment.

Fixed bugs relating to segment coding of INTRA and some
INTER modes at the segment level.

Modified Q boost for static areas based on ambient average Q.

Strong results now on clips with significant static areas.
(some data points in derf set as high as 9% and some static &
slide show type content in YT set > 20%)

Change-Id: Ia79f912efa84b977f35a23683ae3643251e24f0c
2011-11-02 13:31:54 +00:00
Paul Wilkins
23701f4f87 Segmentation Features;
Only encode sign bit for feature data that can have a sign.

Tweaks to the test segmentation rules so that it now actually gives
a net benefit on the derf set of about 0.4% though much higher
on some clips at the low end.

Change-Id: I8e61f1aebf41c9037db7e67e2f8975aa18a0c986
2011-10-24 17:06:29 +01:00
Paul Wilkins
01ce04bc06 Further segment feature extensions.
This quite large check in includes the following:

Merge in some code from Ronald (mbgraph.c) that scans a Gf/arf group.
This is used as a basis for a simple segmentation for the normal frames
in a gf/arf group. This code also uses satd functions from Yaowu.

Adds functionality for coding the latest possible position of an EOB for
blocks in the segment. (Currently 0-15 only, hence just for 4x4 dct).
Where the EOB position is 0 this acts like "skip" and the normal coding
of skip at the per mb level is disabled.

Added functions (seg_common.c) for setting and reading segment feature
elements. These may want to be optimized away at some point but while the
mecahnism is in a state of flux they provide a single location for making
changes and keep things a bit cleaner.

This is still proof of concept code. Currently the tested feature set:-

Quantizer,
Loop Filter level,
Reference frame,
Prediction Mode,
EOB end stop.

TBD:-

Add functions for setting and reading the feature data with range
and validity checking.

Handling of signed and unsigned feature data. At the moment all is assumed
to be signed and a sign bit is coded but many cannot be negative.

Correct handling of EOB feature with intra coded blocks.

Testing/trapping of legal/illegal ref frame and mode combinations.

Transform size switch plus merge and test with 8c8 DCT work

Merge and test with Sumans Segmenation coding optimizations

Change-Id: Iee12e83661c7abbd1e0ce6810915eb4ec35e2d8e
2011-10-24 15:52:18 +01:00
Yaowu Xu
3ca849691c fixed a decoder bug
When 8x8 transform is enabled, the decoder does an extra reconstruct
on MBs that are coded using 8x8. This commit fixed the logic around
the decoding of mb encoded with 8x8 transform.

Change-Id: I6926557c9ef00eecb375f62946f7e140c660bf6f
2011-10-08 15:48:53 -07:00
John Koleszar
feea724296 Merge remote branch 'internal/upstream' into HEAD 2011-09-20 00:05:04 -04:00
Stefan Holmer
e529a825f7 Fix necessary for input partitions iface to match the RTP profile
These changes fixes a glitch between the RTP profile and the input
partitions interface. Since there's no way for the user to know the
actual number of partitions, the decoder have to read the
multi_token_paritition bits also when input partitions mode is
enabled.

Included are also a couple of fixes for issues with independent
partitions and uninitialized memory reads.

Change-Id: I6f93b15287d291169ed681898ed3fbcc5dc81837
2011-09-19 15:00:21 +02:00
Yaowu Xu
ca6b85aa4e add 8x8 intra prediction modes
Patch 1 to Patch 3 is an initial implementation of 8x8 intra prediction
modes, here are with the following assumptions:
a. 8x8 has 4 prediction modes DC, H, V and TM
b. UV 4x4 block use the same mode as corresponding 8x8 area
c. i8x8 modes are enabled for key frame only for now
Patch 4:
d. removed debug code from previous patches
Patch 5:
e. added stats code to collect entropy stats and further cleaned up
Patch 6:
f. changed mode stats code to collect finer stats of modes
Patch 7:
g. normalized i8x8 modes distribution to total at 256 (8bits).
Patch 8:
h. fixed a bug in decoder and removed debug printf output.
Patch 9:
i. more cleanups to address paul's comment
Patch 10:
j. messy rebase/merges to bring the commit up to date.

Tests on HD clips encoded with all key frame showing consistent gain
on all clips and all metrics:~0.5%(psnr) and 0.6%(ssim):
http://www.corp.google.com/~yaowu/no_crawl/i8x8hd_allkey_fixedq.html

To build and test, configure with:
--enable-experimental --enable-i8x8

Change-Id: I9813fe07ae48cab5fdb5d904bca022514ad01e7f
2011-09-16 15:55:19 -07:00
John Koleszar
62371d382a Merge remote branch 'internal/upstream' into HEAD
Conflicts:
	vp8/decoder/decodframe.c
	vp8/encoder/encodeframe.c
	vp8/encoder/encodemb.c

Change-Id: I6e0d1669e4409a2dfd73ba2c7038d730842d3953
2011-09-16 09:22:29 -04:00
Paul Wilkins
ceb5174205 Segment Feature Signaling
Plumbing for tuning new segment features on and off.

Change-Id: If86cd6f103296b73030e8af7cf85c5b9bbffdbaf
2011-09-15 10:19:09 +01:00
Paul Wilkins
1741cc7ab9 Reverse coding order for segment features:
Code all the features for one segment (grouped together)
then all for the next etc. etc. rather than grouping the
data by feature.

Change-Id: I2a65193b3a70aca78f92e855e35d8969d857b6dd
2011-09-13 16:57:17 +01:00
Paul Wilkins
1c24442a07 Change to segment_feature_data[][] structure.
This data structure is  now [Segment ID][Features]
rather than [Features][Segment_ID]

I propose as a separate modification to make the experimental
bit stream reflect this such that all the features for a segment
are coded together.

Change-Id: I581e4e3ca2033bdbdef3d9300977a8202f55b4fb
2011-09-13 12:58:04 +01:00
Paul Wilkins
dfbc61f3ab Segment Features:
Some basic plumbing added for a range of segment level features.
MB_LVL_* changed to SEG_LVL_* to better reflect meaning.

Change-Id: Iac96da36990aa0e40afc0d86e990df337fd0c50b
2011-09-13 11:26:39 +01:00
Scott LaVarnway
b870947d42 Removed bmi copy to/from BLOCKD
for SPLITMV and B_PRED modes.  Modified code to use the bmi
found in mode_info_context instead of BLOCKD.  On the decode
side, the uvmvs are calculated only when required, instead of
every macroblock.  This is WIP. (bmi should eventually be
removed from BLOCKD)
Small performance gains noticed for RT encodes and decodes.(VGA)

Change-Id: I2ed7f0fd5ca733655df684aa82da575c77a973e7
2011-08-24 14:42:26 -04:00
John Koleszar
8f60186502 Merge remote branch 'internal/upstream' into HEAD 2011-08-13 00:05:06 -04:00
Stefan Holmer
a609be5633 Disable error concealment until first key frame is decoded
When error concealment is enabled the first key frame must
be successfully received before error concealment is activated.
Error concealment will be activated when the delta following
delta frame is received.

Also fixed a couple of bugs related to error tracking in
multi-threading. And avoiding decoding corrupt residual
when we have multiple non-resilient partitions.

Change-Id: I45c4bb296e2f05f57624aef500a874faf431a60d
2011-08-12 14:49:34 -04:00
John Koleszar
cdae03a4eb Fix potential OOB read with Error Concealment
This patch fixes an OOB read when error concealment is enabled and the
partition sizes are corrupt. The partition size read from the bitstream
was not being validated in EC mode.

Change-Id: Ia81dfd4bce1ab29ee78e42320abe52cee8318974
2011-08-12 14:49:34 -04:00
Stefan Holmer
3e10be93f2 Disable error concealment until first key frame is decoded
When error concealment is enabled the first key frame must
be successfully received before error concealment is activated.
Error concealment will be activated when the delta following
delta frame is received.

Also fixed a couple of bugs related to error tracking in
multi-threading. And avoiding decoding corrupt residual
when we have multiple non-resilient partitions.

Change-Id: I45c4bb296e2f05f57624aef500a874faf431a60d
2011-08-12 16:10:04 +02:00
John Koleszar
810a06b12c Fix potential OOB read with Error Concealment
This patch fixes an OOB read when error concealment is enabled and the
partition sizes are corrupt. The partition size read from the bitstream
was not being validated in EC mode.

Change-Id: Ia81dfd4bce1ab29ee78e42320abe52cee8318974
2011-08-11 18:07:03 -04:00
John Koleszar
664cd5ac91 Merge remote branch 'internal/upstream' into HEAD 2011-07-23 00:05:14 -04:00
Johann
a04ed0e8f3 fix sharpness bug and clean up
sharpness was not recalculated in vp8cx_pick_filter_level_fast

remove last_filter_type. all values are calculated, don't need to update
the lfi data when it changes.

always use cm->sharpness_level. the extra indirection was annoying.

don't track last frame_type or sharpness_level manually. frame type
only matters for motion search and sharpness_level is taken care of in
frame_init

move function declarations to their proper header

Change-Id: I7ef037bd4bf8cf5e37d2d36bd03b5e22a2ad91db
2011-07-22 12:33:57 -04:00
Yaowu Xu
8c31484ea1 fix more merge issues
With this fix, the experimental branch now builds and encodes correctly
with the following two configure options respectively:
--enable-experimental --enable-t8x8
--enable-experimental

Change-Id: I3147c33c503fe713a85fd371e4f1a974805778bf
2011-07-21 09:01:53 -07:00
Deb Mukherjee
08f6471890 Add 8x8 transform to experimental branch
Please refer to previous commit messages for detailed info:
https://on2-git.corp.google.com/g/#change,5940
https://on2-git.corp.google.com/g/#change,6045

Change-Id: I8b16992f2f69c5a808ad40a3e32ef589cce7c59d
2011-07-20 09:49:22 -07:00
John Koleszar
9dfd006017 Merge remote branch 'internal/upstream-experimental' into HEAD
Conflicts:
	vp8/encoder/bitstream.c

Change-Id: I44c00f98dcb99eb728ce4f5256aefb135a711a74
2011-06-30 08:46:49 -04:00
John Koleszar
b32da7c3da Use MAX_ENTROPY_TOKENS and ENTROPY_NODES more consistently
There were many instances in the code of vp8_coef_tokens and
vp8_coef_tokens-1, which was a preprocessor macro despite the naming
convention. Replace these with MAX_ENTROPY_TOKENS and ENTROPY_NODES,
respectively.

Change-Id: I72c4f6c7634c94e1fa066cd511471e5592c748da
2011-06-28 17:03:55 -04:00
John Koleszar
9bcf07ae4a Merge "Simplify decode_macroblock." 2011-06-28 12:54:25 -07:00
Gaute Strokkenes
81c0546407 Simplify decode_macroblock.
Change-Id: Ieb2f3827ae7896ae594203b702b3e8fa8fb63d37
2011-06-28 17:01:14 +01:00
Stefan Holmer
7296b3f922 New ways of passing encoded data between encoder and decoder.
With this commit frames can be received partition-by-partition
from the encoder and passed partition-by-partition to the
decoder.

At the encoder-side this makes it easier to split encoded
frames at partition boundaries, useful when packetizing
frames. When VPX_CODEC_USE_OUTPUT_PARTITION is enabled,
several VPX_CODEC_CX_FRAME_PKT packets will be returned
from vpx_codec_get_cx_data(), containing one partition
each. The partition_id (starting at 0) specifies the decoding
order of the partitions. All partitions but the last has
the VPX_FRAME_IS_FRAGMENT flag set.

At the decoder this opens up the possibility of decoding partition
N even though partition N-1 was lost (given that independent
partitioning has been enabled in the encoder) if more info
about the missing parts of the stream is available through
external signaling.

Each partition is passed to the decoder through the
vpx_codec_decode() function, with the data pointer pointing
to the start of the partition, and with data_sz equal to the
size of the partition. Missing partitions can be signaled to
the decoder by setting data != NULL and data_sz = 0. When
all partitions have been given to the decoder "end of data"
should be signaled by calling vpx_codec_decode() with
data = NULL and data_sz = 0.

The first partition is the first partition according to the
VP8 bitstream + the uncompressed data chunk + DCT address
offsets if multiple residual partitions are used.

Change-Id: I5bc0682b9e4112e0db77904755c694c3c7ac6e74
2011-06-28 11:10:17 -04:00
John Koleszar
d7c6c9472f Merge remote branch 'internal/upstream-experimental' into HEAD 2011-06-28 00:05:04 -04:00
Stefan Holmer
ba0822ba96 Adding support for error concealment in multi-threaded decoding
Also includes a couple of error concealment bug fixes:
- the segment_id wasn't properly initialized when missing
- when interpolating and no neighbors are found, set to zero
- clear the qcoef buffer when concealing an MB

Change-Id: Id79c876b41d78b559a2241e9cd0fd2cae6198f49
2011-06-27 09:03:06 -04:00
John Koleszar
deb2e9cf62 Merge remote branch 'internal/upstream' into HEAD
Conflicts:
	vp8/encoder/encodeframe.c
	vp8/encoder/rdopt.c

Change-Id: I183fd3ce9e94617ec888c9f891055b9f1f8ca6c5
2011-06-17 15:36:43 -04:00
James Zern
532c30c83e fix corrupt frame leak
If setup_token_decoder reported an internal error the memory allocated
there would not be freed in the resulting call to _remove_decompressor.

Change-Id: Ib459de222d76b1910d6f449cdcd01663447dbdf6
2011-06-13 17:32:19 -07:00
John Koleszar
be15a09980 Merge remote branch 'internal/upstream-experimental' into HEAD
Conflicts:
	vp8/encoder/encodeframe.c

Change-Id: Ibb5a3894ede08ed401ec6e974a8902d7393c9978
2011-06-06 15:50:48 -04:00
Scott LaVarnway
773768ae27 Removed B_MODE_INFO
Declared the bmi in BLOCKD as a union instead of B_MODE_INFO.
Then removed B_MODE_INFO completely.

Change-Id: Ieb7469899e265892c66f7aeac87b7f2bf38e7a67
2011-06-02 13:46:41 -04:00
John Koleszar
9dccdc1f08 Merge remote branch 'internal/upstream-experimental' into HEAD
Conflicts:
	vp8/encoder/encodeframe.c
	vp8/encoder/ethreading.c

Change-Id: I4becf6f101756923de6b98ca6a2132c3605c6ea5
2011-05-26 11:44:36 -04:00
Scott LaVarnway
cfab2caee1 Removed unused variable warnings
Change-Id: I6e5e921f03dc15a72da89a457848d519647677a3
2011-05-24 15:17:03 -04:00
Scott LaVarnway
e11f21af9a MODE_INFO size reduction
Declared the bmi in MODE_INFO as a union instead of B_MODE_INFO.
This reduced the memory footprint by 518,400 bytes for 1080
resolutions.  The decoder performance improved by ~4% for the
clip used and the encoder showed very small improvements. (0.5%)
This reduction was first mentioned to me by John K. and in a
later discussion by Yaowu.
This is WIP.

Change-Id: I8e175fdbc46d28c35277302a04bee4540efc8d29
2011-05-24 13:24:52 -04:00
John Koleszar
27331e1377 Merge remote branch 'internal/upstream' into HEAD 2011-05-20 00:05:16 -04:00
Stefan Holmer
d04f852368 Adding error-concealment to the decoder.
The error-concealer is plugged in after any motion vectors have been
decoded. It tries to estimate any missing motion vectors from the
motion vectors of the previous frame. Intra blocks with missing
residual are replaced with inter blocks with estimated motion vectors.

This feature was developed in a separate sandbox
(sandbox/holmer/error-concealment).

Change-Id: I5c8917b031078d79dbafd90f6006680e84a23412
2011-05-19 13:46:33 -04:00
John Koleszar
8398449cbf Merge remote branch 'internal/upstream' into HEAD 2011-04-30 00:05:05 -04:00
Scott LaVarnway
ccd6f7ed77 Consolidated build inter predictors
Code cleanup.

Change-Id: Ic8b0167851116c64ddf08e8a3d302fb09ab61146
2011-04-28 10:53:59 -04:00
John Koleszar
e1b90ce862 Merge remote branch 'internal/upstream' into HEAD 2011-04-28 00:05:07 -04:00