# Sources: https://github.com/hl2guide/better-mpv-config
#          https://raw.githubusercontent.com/classicjazz/mpv-config/master/mpv.conf

# Uses GPU-accelerated video output by default.
vo=gpu
# Can cause performance problems with some GPU drivers and GPUs.
profile=gpu-hq
# Enables best HW decoder; turn off for software decoding
hwdec=auto

# UI
border=yes # keep the window title bar
msg-color=yes # color log messages on terminal
term-osd-bar=yes # displays a progress bar on the terminal
cursor-autohide=1000 # autohides the cursor after 1s
loop-file=yes
osd-font='Iosevka'
# osd-font-size=55
# osd-scale=0.5
save-position-on-quit=no

# Uses a large seekable RAM cache even for local input.
cache=yes
# cache-secs=300
# Uses extra large RAM cache (needs cache=yes to make it useful).
demuxer-max-bytes=1800M
demuxer-max-back-bytes=1200M

# Sets the profile restore method to "copy if equal"
profile-restore=copy-equal

# ===== Audio =====

# Sets volume to 60%.
volume=60

# Normalizes audio
af-add='dynaudnorm=g=5:f=250:r=0.9:p=0.5'

# ===== Color Space =====
target-trc=auto
gamma-auto
vf=format=colorlevels=full:colormatrix=auto
video-output-levels=full

# ===== Dithering =====
dither-depth=auto
temporal-dither=yes
dither=fruit

# ===== Debanding =====
deband=yes # enabled by default
deband-iterations=4 # deband steps
deband-threshold=48 # deband strength
deband-range=16 # deband range
deband-grain=48 # dynamic grain: set to "0" if using the static grain shader

# ===== Subtitles =====
blend-subtitles=yes

# ===== Motion Interpolation =====
# override-display-fps=60
# video-sync=display-resample
# interpolation=yes
# tscale=oversample # smoothmotion

# ===== Anti-Ringing =====
scale-antiring=0.7 # luma upscale deringing
dscale-antiring=0.7 # luma downscale deringing
cscale-antiring=0.7 # chroma upscale deringing

# ===== Upscaling & Processing =====
# NOTE: glsl-shaders is a list of files
glsl-shaders-clr # Clear shaders

# luma upscaling
# note: any FSRCNNX above FSRCNNX_x2_8-0-4-1 is not worth the additional computional overhead
# glsl-shaders="~~/shaders/FSRCNNX_x2_8-0-4-1.glsl" # Set shaders list to one shader
scale=ewa_lanczos

# luma downscaling
# note: ssimdownscaler is tuned for mitchell and downscaling=no
# glsl-shaders-append="~~/shaders/SSimDownscaler.glsl" # Add shader to the list
dscale=mitchell
linear-downscaling=no

# chroma upscaling and downscaling
# glsl-shaders-append="~~/shaders/KrigBilateral.glsl"
cscale=mitchell
sigmoid-upscaling=yes

