Skip to content

Commit

Permalink
#823: add support for lossless mode at 100% quality
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@8950 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Apr 7, 2015
1 parent 3ec62d7 commit 42e63c0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/xpra/codecs/vpx/encoder.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ cdef extern from "vpx/vpx_encoder.h":
int VP8E_SET_CPUUSED
#function to enable/disable periodic Q boost:
int VP9E_SET_FRAME_PERIODIC_BOOST
int VP9E_SET_LOSSLESS
#vpx_enc_pass:
int VPX_RC_ONE_PASS
int VPX_RC_FIRST_PASS
Expand Down Expand Up @@ -558,6 +559,8 @@ cdef class Encoder:
return img

def set_encoding_speed(self, int pct):
if self.speed==pct:
return
self.speed = pct
#Valid range for VP8: -16..16
#Valid range for VP9: -8..8
Expand All @@ -568,8 +571,11 @@ cdef class Encoder:
self.codec_control("cpu speed", VP8E_SET_CPUUSED, value)

def set_encoding_quality(self, int pct):
if self.quality==pct:
return
self.quality = pct
self.update_cfg()
self.codec_control("lossless", VP9E_SET_LOSSLESS, pct==100)
cdef vpx_codec_err_t ret = vpx_codec_enc_config_set(self.context, self.cfg)
assert ret==0, "failed to updated encoder configuration, vpx_codec_enc_config_set returned %s" % ret

Expand Down

0 comments on commit 42e63c0

Please sign in to comment.