xref: /aosp_15_r20/external/libaom/test/run_encodes.sh (revision 77c1e3ccc04c968bd2bc212e87364f250e820521)
1*77c1e3ccSAndroid Build Coastguard Worker#!/bin/bash
2*77c1e3ccSAndroid Build Coastguard Worker#
3*77c1e3ccSAndroid Build Coastguard Worker# Copyright (c) 2016, Alliance for Open Media. All rights reserved.
4*77c1e3ccSAndroid Build Coastguard Worker#
5*77c1e3ccSAndroid Build Coastguard Worker# This source code is subject to the terms of the BSD 2 Clause License and
6*77c1e3ccSAndroid Build Coastguard Worker# the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
7*77c1e3ccSAndroid Build Coastguard Worker# was not distributed with this source code in the LICENSE file, you can
8*77c1e3ccSAndroid Build Coastguard Worker# obtain it at www.aomedia.org/license/software. If the Alliance for Open
9*77c1e3ccSAndroid Build Coastguard Worker# Media Patent License 1.0 was not distributed with this source code in the
10*77c1e3ccSAndroid Build Coastguard Worker# PATENTS file, you can obtain it at www.aomedia.org/license/patent.
11*77c1e3ccSAndroid Build Coastguard Worker#
12*77c1e3ccSAndroid Build Coastguard Worker# Author: [email protected] (Jim Bankoski)
13*77c1e3ccSAndroid Build Coastguard Worker
14*77c1e3ccSAndroid Build Coastguard Workerif [[ $# -ne 4 ]]; then
15*77c1e3ccSAndroid Build Coastguard Worker  echo Encodes all the y4m files in the directory at the bitrates specified by
16*77c1e3ccSAndroid Build Coastguard Worker  echo the first 3 parameters and stores the results in a subdirectory named by
17*77c1e3ccSAndroid Build Coastguard Worker  echo the 4th parameter:
18*77c1e3ccSAndroid Build Coastguard Worker  echo
19*77c1e3ccSAndroid Build Coastguard Worker  echo Usage:    run_encodes.sh start-kbps end-kbps step-kbps output-directory
20*77c1e3ccSAndroid Build Coastguard Worker  echo Example:  run_encodes.sh 200 500 50 baseline
21*77c1e3ccSAndroid Build Coastguard Worker  exit
22*77c1e3ccSAndroid Build Coastguard Workerfi
23*77c1e3ccSAndroid Build Coastguard Worker
24*77c1e3ccSAndroid Build Coastguard Workers=$1
25*77c1e3ccSAndroid Build Coastguard Workere=$2
26*77c1e3ccSAndroid Build Coastguard Workerstep=$3
27*77c1e3ccSAndroid Build Coastguard Workernewdir=$4
28*77c1e3ccSAndroid Build Coastguard Worker
29*77c1e3ccSAndroid Build Coastguard Workerfor i in ./*y4m; do
30*77c1e3ccSAndroid Build Coastguard Worker  for (( b=$s; b<= $e; b+= $step ))
31*77c1e3ccSAndroid Build Coastguard Worker  do
32*77c1e3ccSAndroid Build Coastguard Worker    best_encode.sh $i $b
33*77c1e3ccSAndroid Build Coastguard Worker  done
34*77c1e3ccSAndroid Build Coastguard Worker  mv opsnr.stt $i.stt
35*77c1e3ccSAndroid Build Coastguard Workerdone
36*77c1e3ccSAndroid Build Coastguard Worker
37*77c1e3ccSAndroid Build Coastguard Workermkdir $newdir
38*77c1e3ccSAndroid Build Coastguard Workermv *.stt $newdir
39*77c1e3ccSAndroid Build Coastguard Workermv *.webm $newdir
40