summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_segmentation.c
AgeCommit message (Collapse)Author
2013-09-24Correctly set the segment_id prediction flag and contextGuillaume Martres
This fix a bug introduced by ac6093d179d8488f90bf10c6d0abcc48be327d28 Change-Id: I0700a4daf7a6a2471074f81a4596352287fb2ac9
2013-09-11New mode_info_context storage -- undo revertScott LaVarnway
mode_info_context was stored as a grid of MODE_INFO structs. The grid now constists of pointers to MODE_INFO structs. The MODE_INFO structs are now stored as a stream (decoder only), eliminating unnecessary copies and is a little more cache friendly. Change-Id: I031d376284c6eb98a38ad5595b797f048a6cfc0d
2013-09-09Revert "New mode_info_context storage"James Zern
This reverts commit dae17734ece414091ba1184f7becd0aa6c0004f1 Encode crashes, leaks and increases integer overflow errors. Change-Id: I595aa2649bb8d0b6552ff91652837a74c103fda2
2013-09-06New mode_info_context storageScott LaVarnway
mode_info_context was stored as a grid of MODE_INFO structs. The grid now constists of a pointer to a MODE_INFO struct and a "in the image" flag. The MODE_INFO structs are now stored as a stream, eliminating unnecessary copies and is a little more cache friendly. For the test clips used, the decoder performance improved by ~4.3% (1080p) and ~9.7% (720p). Patch Set 2: Re-encoded clips with latest. Now ~1.7% (1080p) and 5.9% (720p). Change-Id: I846f29e88610fce2523ca697a9a9ef2a182e9256
2013-08-27Renaming BLOCK_SIZE_TYPE to BLOCK_SIZE in the encoder.Dmitry Kovalev
Change-Id: I62bb07c377f947cb72fac68add7a6b199e42c6b9
2013-08-26Using num_8x8_* lookup tables instead of mi_*_log2.Dmitry Kovalev
Change-Id: I8a246b3d056c98be614d05a90bc261e2441ffc10
2013-08-15Merge "Moving segmentation struct from MACROBLOCKD to VP9_COMMON."Dmitry Kovalev
2013-08-15Using { 0 } for initialization instead of memset.Dmitry Kovalev
Change-Id: I4fad357465022d14bfc7e13b348c6da267587314
2013-08-15Moving segmentation struct from MACROBLOCKD to VP9_COMMON.Dmitry Kovalev
VP9_COMMON is the right place to segmentatation struct because it has global segmentation parameters, not something specific to macroblock processing. Change-Id: Ib9ada0c06c253996eb3b5f6cccf6a323fbbba708
2013-08-05Replacing long block size enum values with shorter ones (2).Dmitry Kovalev
Change-Id: I428c4d42212b757112e3acfe5b81314cfbb5fd6b
2013-08-02Replacing long block size enum values with shorter ones.Dmitry Kovalev
Change-Id: I0e9329490828684a4fd46f540d89114cc68e8407
2013-08-01Cleanup: removing unused function arguments.Dmitry Kovalev
Change-Id: I27471768980fc631916069f24bc7c482a5c9ca17
2013-07-23Renaming of segment constants.Paul Wilkins
Renamed: MAX_MB_SEGMENTS to MAX_SEGMENTS MB_SEG_TREE_PROBS to SEG_TREE_PROBS The minimum unit for segmentation in the segment map is now 8x8 so it is misleading to use MB_ as macro-block traditionally refers to a 16x16 region. Change-Id: I0b55a6f0426bb46dd13435fcfa5bae0a30a7fa22
2013-07-16Cleaning up tile code.Dmitry Kovalev
Removing tile_rows and tile_columns from VP9Common, removing redundant constants MIN_TILE_WIDTH and MAX_TILE_WIDTH, changing signature of vp9_get_tile_n_bits. Change-Id: I8ff3104a38179b2c6900df965c144c1d6f602267
2013-07-16Rewriting vp9_set_pred_flag_{seg_id, mbskip}.Dmitry Kovalev
Making implementation of vp9_set_pred_flag_{seg_id, mbskip} consistent with vp9_get_segment_id without using confusing sub(a, b) macro. Passing mi_row and mi_col to functions explicitly instead of replying on mb_to_right_edge and mb_to_bottom_edge. Change-Id: I54c1087dd2ba9036f8ba7eb165b073e807d00435
2013-07-11Removing redundant code mostly from vp9_pred_common.{h, c}.Dmitry Kovalev
Removing redundant function arguments and curly braces. Change-Id: I46e02561f33fe02e84a3b19756f03b9504bd6a1b
2013-07-11Moving segmentation related vars into separate struct.Dmitry Kovalev
Adding segmentation struct to vp9_seg_common.h. Struct members are from macroblockd and VP9Common structs. Moving segmentation related constants and enums to vp9_seg_common.h. Change-Id: I23fabc33f11a359249f5f80d161daf569d02ec03
2013-07-09removing case statements around prediction entropy codingJim Bankoski
Removes SEG_ID Removes MBSKIP Removes SWITCHABLE_INTERP Removes INTRA_INTER Removes COMP_INTER_INTER Removes COMP_REF_P Removes SINGLE_REF_P1 Removes SINGLE_REF_P2 Removes TX_SIZE Change-Id: Ie4520ae1f65c8cac312432c0616cc80dea5bf34b
2013-06-27Decoder's code cleanup.Dmitry Kovalev
Using vp9_set_pred_flag function instead of custom code, adding decode_tokens function which is now called from decode_atom, decode_sb_intra, and decode_sb. Change-Id: Ie163a7106c0241099da9c5fe03069bd71f9d9ff8
2013-06-26General cleanup in segmentation-related code.Dmitry Kovalev
Using consistent function and variable names. Change-Id: I2deb3fded8797453a2081836c9ce2e79ade06eb7
2013-06-21Removing find_seg_id and using vp9_get_pred_mi_segid instead.Dmitry Kovalev
Change-Id: Ia40229903c08f14020e90e94cfdf494aba1be827
2013-05-07Merge SB8X8 into the codebaseJingning Han
Pull sb8x8 out of experimental list. verified via borg run tests. Fixed unit test failures. Change-Id: I12a4bbd17395930580c048ab68becad1ffe46e76
2013-05-02vp9/count_segs: fix out of bounds readJames Zern
don't access mi until mi_{row,col} validation has been done Change-Id: Ie1be052612cfccb2730dff9281c222bca28bf2c6
2013-05-02Merge "Using treed_read/treed_write functions for segment ids." into ↵Dmitry Kovalev
experimental
2013-04-30Merge "Cleaning up encoder segmentation code." into experimentalDmitry Kovalev
2013-04-30sb8x8 integration in rd loop.Ronald S. Bultje
Work-in-progress, not yet ready for review. TODO items: - bitstream writing (encoder) and reading (decoder) - decoder reconstruction Change-Id: I5afb7284e7e0480847b47cd0097cb469433c9081
2013-04-30Using treed_read/treed_write functions for segment ids.Dmitry Kovalev
Changing the order of probabilities inside mb_segment_tree_probs in order to use treed_read/treed_write function instead of custom code. Change-Id: I843487d5057913b9358db73da270893eefecc6c8
2013-04-29Cleaning up encoder segmentation code.Dmitry Kovalev
Moving code from vp9_pack_bitstream to new function encode_segmentation. Change-Id: I1f1e59a1f038618ad95162b7db4b6f8164850ea8
2013-04-29Use recursive function in choosing segmentation map coding method.Ronald S. Bultje
This is shorter than fully writing out all cases (55 vs. 84 LOC), and is easier to extend. Change-Id: Ibad1bf6463198cad9188c5507181d4b03d393e6d
2013-04-26Grow MODE_INFO array to use an 8x8 basis.Ronald S. Bultje
Change-Id: I087e08e7909a406b71715b8525c104208daa6889
2013-04-25Merge "Move sbsegment out of experimental list" into experimentalJingning Han
2013-04-24Merge two similar functions into oneYaowu Xu
Function set_mb_row() and set_mb_col() do similar work and are always called together, this commit merged them into a single function for clarity and easy maintainence. This was a TODO item. Change-Id: I956bd9ed6afb8b2b0469b20fd8bc893b26f8a0f3
2013-04-24Move sbsegment out of experimental listJingning Han
Move rectangular superblock coding out of experimental list. Change-Id: I96c37547d122330d666a67b4bf577ae54547857f
2013-04-24Extension of segmentation to 8 segments.Paul Wilkins
Also some further simplification following removal of top node code. There is an issue in regards to the shared file vp8cx.h in regard to the roi_map as this interface assumes that there are only 4 segments. I have left the value here as 4 for now meaning that the roi_map interface is broken for VP9. Note that this change would have been easier if I hadn't had to search for hard wire instances of the number 4 and <= 3. Change-Id: Ia8b6deea4be4dbd20deb1656e689dd43a5f190e8
2013-04-24Simplify Segment CodingPaul Wilkins
Remove top node optimization. The improvement this gives is not sufficient to justify the extra complexity. Change-Id: I2bb4a12a50ffd52cacfa4a3e8acbb2e522066905
2013-04-20Merge "Removing get_segment_id function and using existing ↵Dmitry Kovalev
vp9_get_pred_mb_segid." into experimental
2013-04-19Removing get_segment_id function and using existing vp9_get_pred_mb_segid.Dmitry Kovalev
Change-Id: Iff35d4b2f8f65511f80c594958c01fb4673fa033
2013-04-19Clean out some legacy code.Paul Wilkins
Removed some unused legacy code relating to GF activity. Change-Id: I0b0fe90a1a5208aaa81d7393ba6cf75ab412dbda
2013-04-17Fairly basic integration of rectangular blocks in encoding RD loop.Ronald S. Bultje
Adds RD integration for 32x16, 16x32, 64x32 and 32x64 rectangular blocks. Derf almost +0.6%, HD a little over +1.0%, STDHD +1.3%. Change-Id: Id651fdb6a655fdbb5c47009757e63317acfb88a5
2013-03-07Coding con-zero count rather than EOB for coeffsDeb Mukherjee
This patch revamps the entropy coding of coefficients to code first a non-zero count per coded block and correspondingly remove the EOB token from the token set. STATUS: Main encode/decode code achieving encode/decode sync - done. Forward and backward probability updates to the nzcs - done. Rd costing updates for nzcs - done. Note: The dynamic progrmaming apporach used in trellis quantization is not exactly compatible with nzcs. A suboptimal approach has been used instead where branch costs are updated to account for changes in the nzcs. TODO: Training the default probs/counts for nzcs Change-Id: I951bc1e22f47885077a7453a09b0493daa77883d
2013-02-21Code cleanup.Dmitry Kovalev
Removing redundant 'extern' keyword from function declarations and making function arguments lower case. Change-Id: Idae9a2183b067f2b6c85ad84738d275e8bbff9d9
2013-02-13Add support for tile rows.Ronald S. Bultje
These allow sending partial bitstream packets over the network before encoding a complete frame is completed, thus lowering end-to-end latency. The tile-rows are not independent. Change-Id: I99986595cbcbff9153e2a14f49b4aa7dee4768e2
2013-02-12Add tile column size limits (256 pixels min, 4096 pixels max).Ronald S. Bultje
This is after discussion with the hardware team. Update the unit test to take these sizes into account. Split out some duplicate code into a separate file so it can be shared. Change-Id: I8311d11b0191d8bb37e8eb4ac962beb217e1bff5
2013-02-06Reindent segmentation code.Ronald S. Bultje
Indentation was off by 2 spaces for this particular block. Change-Id: I1e587b7ad3eff77ade5521252d20c7bb2daa0f6d
2013-02-05[WIP] Add column-based tiling.Ronald S. Bultje
This patch adds column-based tiling. The idea is to make each tile independently decodable (after reading the common frame header) and also independendly encodable (minus within-frame cost adjustments in the RD loop) to speed-up hardware & software en/decoders if they used multi-threading. Column-based tiling has the added advantage (over other tiling methods) that it minimizes realtime use-case latency, since all threads can start encoding data as soon as the first SB-row worth of data is available to the encoder. There is some test code that does random tile ordering in the decoder, to confirm that each tile is indeed independently decodable from other tiles in the same frame. At tile edges, all contexts assume default values (i.e. 0, 0 motion vector, no coefficients, DC intra4x4 mode), and motion vector search and ordering do not cross tiles in the same frame. t log Tile independence is not maintained between frames ATM, i.e. tile 0 of frame 1 is free to use motion vectors that point into any tile of frame 0. We support 1 (i.e. no tiling), 2 or 4 column-tiles. The loopfilter crosses tile boundaries. I discussed this briefly with Aki and he says that's OK. An in-loop loopfilter would need to do some sync between tile threads, but that shouldn't be a big issue. Resuls: with tiling disabled, we go up slightly because of improved edge use in the intra4x4 prediction. With 2 tiles, we lose about ~1% on derf, ~0.35% on HD and ~0.55% on STD/HD. With 4 tiles, we lose another ~1.5% on derf ~0.77% on HD and ~0.85% on STD/HD. Most of this loss is concentrated in the low-bitrate end of clips, and most of it is because of the loss of edges at tile boundaries and the resulting loss of intra predictors. TODO: - more tiles (perhaps allow row-based tiling also, and max. 8 tiles)? - maybe optionally (for EC purposes), motion vectors themselves should not cross tile edges, or we should emulate such borders as if they were off-frame, to limit error propagation to within one tile only. This doesn't have to be the default behaviour but could be an optional bitstream flag. Change-Id: I5951c3a0742a767b20bc9fb5af685d9892c2c96f
2013-01-30don't code the branch for the predicted seg_id if that flag is false.Ronald S. Bultje
Change-Id: Icb6e21dc0c2d9918faa33c8bf70943660df7ad88
2013-01-16Start to anonymize reference framesJohn Koleszar
Remove lst_fb_idx, gld_fb_idx, alt_fb_idx, refresh_last_frame, refresh_golden_frame, refresh_alt_ref_frame from common. Gold/Alt are encode side conventions. From the decoder's perspective, we want to be dealing with numbered references. Updates to active_ref 2 signal mode context switches, vestigial from refresh_alt_ref_frame. This needs some clean up to make sense with increased numbers of reference frames, as well as reimplementing the swapping of alt/golden which was previously done using the buffer-to-buffer copy mechanism removed in an earlier commit. Change-Id: I7334445158b7666f9295d2a2dd22aa03f4485f58
2013-01-09Merge superblocks64 experiment.Ronald S. Bultje
Change-Id: If6c88752dffdb566f8d4322f135145270716fb8e
2013-01-08Merge superblocks (32x32) experiment.Ronald S. Bultje
Change-Id: I0df99742029834a85c4933652b0587cf5b6b2587
2013-01-0564x64 blocksize support.Ronald S. Bultje
3.2% gains on std/hd, 1.0% gains on hd. Change-Id: I481d5df23d8a4fc650a5bcba956554490b2bd200