edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiB8defefbTahinli6 days ago3947 commits
| 1 | #!/usr/bin/env bash |
| 2 | # hevc-bdrate.sh: BD-rate of ec-h265's IDR+P sequence encoder against libx265 at the |
| 3 | # same QPs, with x265 at bframes=0 and the same keyframe interval. |
| 4 | # |
| 5 | # Each side is encoded at QPS (default "22 27 32 37") on one clip; the points are |
| 6 | # (bytes, Y and YUV PSNR of the decoded/reconstructed frames against the source, |
| 7 | # from ffmpeg's psnr filter, see ffmpeg-psnr.sh). The |
| 8 | # anchor is libx265 (-preset veryfast, -qp, -x265-params bframes=0:keyint=GOP), the |
| 9 | # test is ec-h265. Positive bd_rate_pct means ec-h265 needs more bytes. |
| 10 | # |
| 11 | # The anchor is run with `-tune psnr` (X265_TUNE, default psnr; set X265_TUNE= to run |
| 12 | # x265 at its default psy-rd/aq tuning). psy-rd and aq trade PSNR for perceptual detail, and |
| 13 | # ec-h265 has neither, so the PSNR-only tune is the matched anchor for a BD-PSNR comparison. |
| 14 | # |
| 15 | # Each point file row: bytes, psnr_y, psnr_yuv, psnr_u, psnr_v, kbps (30 fps, so kbps is |
| 16 | # bytes*8 divided by the clip duration in seconds). |
| 17 | # |
| 18 | # Usage: scripts/hevc-bdrate.sh <clip.yuv> <width> <height> [GOP] [QPS] |
| 19 | # Environment: DATA (default $HOME/.cache/hevcencp-data), X265_TUNE (default psnr). |
| 20 | |
| 21 | |
| 22 | here= |
| 23 | clip= |
| 24 | w= |
| 25 | h= |
| 26 | gop= |
| 27 | qps= |
| 28 | data= |
| 29 | |
| 30 | [ || clip="/" |
| 31 | tag=-x-k |
| 32 | # PIX=yuv420p10le runs the Main 10 comparison: 16-bit samples, EC_H265_BITDEPTH=10. |
| 33 | pix= |
| 34 | bps=1 |
| 35 | [ && bps=2 |
| 36 | |
| 37 | frames= |
| 38 | |
| 39 | |
| 40 | target= |
| 41 | |
| 42 | gopbin="/release/examples/hevc_gop" |
| 43 | |
| 44 | anchor="/.x265.tsv" |
| 45 | test_="/.ec.tsv" |
| 46 | |
| 47 | |
| 48 | for; do |
| 49 | x265="/-qp.x265.hevc" |
| 50 | tune=() |
| 51 | [ && tune=(-tune "") |
| 52 | profile=() |
| 53 | [ && profile=(-profile:v main10) |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | xdec="/-qp.x265.yuv" |
| 59 | |
| 60 | xline= |
| 61 | xpy= |
| 62 | xpsnr= |
| 63 | xpu= |
| 64 | xpv= |
| 65 | xbytes= |
| 66 | |
| 67 | |
| 68 | ours="/-qp.ec.hevc" |
| 69 | recon="/-qp.ec.recon.yuv" |
| 70 | |
| 71 | oline= |
| 72 | opy= |
| 73 | opsnr= |
| 74 | opu= |
| 75 | opv= |
| 76 | obytes= |
| 77 | |
| 78 | |
| 79 | done |
| 80 | |
| 81 | |
| 82 | ; |
| 83 | ; |
| 84 | |
| 85 | |
| 86 | |
| 87 |