summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_bitstream.c
diff options
context:
space:
mode:
authorYaowu Xu <yaowu@google.com>2013-02-11 21:14:46 -0800
committerYaowu Xu <yaowu@google.com>2013-02-13 09:24:39 -0800
commit17db5d00be2f005f11428edf0fd23265d04d100f (patch)
treef6f0890b6c3351dcfcb030fdd86491dfc16a9489 /vp9/encoder/vp9_bitstream.c
parent16f25f9dc83a37f2a16c7652445b6a6ecf8034af (diff)
downloadlibvpx-17db5d00be2f005f11428edf0fd23265d04d100f.tar
libvpx-17db5d00be2f005f11428edf0fd23265d04d100f.tar.gz
libvpx-17db5d00be2f005f11428edf0fd23265d04d100f.tar.bz2
libvpx-17db5d00be2f005f11428edf0fd23265d04d100f.zip
enable bitstream lossless support
1. Added a bit in frame header to to indicate if a frame is encoded in lossless mode, so decoder does not make the decision based on Q0 2. Minor changes to make sure that lossy coding works same as when the lossless experiment is not enabled. 3. Renamed function pointers for transforms to be consistent, using prefix fwd_txm and inv_txm for forward and inverse respectively To encode in lossless mode, using "--lossless=1 --min-q=0 --max-q=0" with vpxenc. Change-Id: Ifae53b26d2ffbe378d707e29d96817b8a5e6c068
Diffstat (limited to 'vp9/encoder/vp9_bitstream.c')
-rw-r--r--vp9/encoder/vp9_bitstream.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/vp9/encoder/vp9_bitstream.c b/vp9/encoder/vp9_bitstream.c
index a3c407865..89a1c2c57 100644
--- a/vp9/encoder/vp9_bitstream.c
+++ b/vp9/encoder/vp9_bitstream.c
@@ -1667,7 +1667,13 @@ void vp9_pack_bitstream(VP9_COMP *cpi, unsigned char *dest,
vp9_write_literal(&header_bc, pc->sb64_coded, 8);
pc->sb32_coded = get_binary_prob(cpi->sb32_count[0], cpi->sb32_count[1]);
vp9_write_literal(&header_bc, pc->sb32_coded, 8);
-
+#if CONFIG_LOSSLESS
+ vp9_write_bit(&header_bc, cpi->oxcf.lossless);
+ if (cpi->oxcf.lossless) {
+ pc->txfm_mode = ONLY_4X4;
+ }
+ else
+#endif
{
if (pc->txfm_mode == TX_MODE_SELECT) {
pc->prob_tx[0] = get_prob(cpi->txfm_count_32x32p[TX_4X4] +