<commit_before>#!/bin/sh
## Copyright (c) 2016, Alliance for Open Media. All rights reserved
##
## This source code is subject to the terms of the BSD 2 Clause License and
## the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
## was not distributed with this source code in the LICENSE file, you can
## obtain it at www.aomedia.org/license/software. If the Alliance for Open
## Media Patent License 1.0 was not distributed with this source code in the
## PATENTS file, you can obtain it at www.aomedia.org/license/patent.
##
## This file tests aomenc using hantro_collage_w352h288.yuv as input. To add
## new tests to this file, do the following:
##   1. Write a shell function (this is your test).
##   2. Add the function to aomenc_tests (on a new line).
##
. $(dirname $0)/tools_common.sh

readonly TEST_FRAMES=10

# Environment check: Make sure input is available.
aomenc_verify_environment() {
  if [ ! -e "${YUV_RAW_INPUT}" ]; then
    elog "The file ${YUV_RAW_INPUT##*/} must exist in LIBAOM_TEST_DATA_PATH."
    return 1
  fi
  if [ "$(aomenc_can_encode_av1)" = "yes" ]; then
    if [ ! -e "${Y4M_NOSQ_PAR_INPUT}" ]; then
      elog "The file ${Y4M_NOSQ_PAR_INPUT##*/} must exist in"
      elog "LIBAOM_TEST_DATA_PATH."
      return 1
    fi
  fi
  if [ -z "$(aom_tool_path aomenc)" ]; then
    elog "aomenc not found. It must exist in LIBAOM_BIN_PATH or its parent."
    return 1
  fi
}

aomenc_can_encode_vp8() {
  if [ "$(vp8_encode_available)" = "yes" ]; then
    echo yes
  fi
}

aomenc_can_encode_av1() {
  if [ "$(av1_encode_available)" = "yes" ]; then
    echo yes
  fi
}

# Utilities that echo aomenc input file parameters.
y4m_input_non_square_par() {
  echo ""${Y4M_NOSQ_PAR_INPUT}""
}

y4m_input_720p() {
  echo ""${Y4M_720P_INPUT}""
}

# Echo default aomenc real time encoding params. $1 is the codec, which defaults
# to vp8 if unspecified.
aomenc_rt_params() {
  local readonly codec="${1:-vp8}"
  echo "--codec=${codec}
    --buf-initial-sz=500
    --buf-optimal-sz=600
    --buf-sz=1000
    --cpu-used=-6
    --end-usage=cbr<commit_msg>Use "av1" as codec name<commit_after>#!/bin/sh
## Copyright (c) 2016, Alliance for Open Media. All rights reserved
##
## This source code is subject to the terms of the BSD 2 Clause License and
## the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
## was not distributed with this source code in the LICENSE file, you can
## obtain it at www.aomedia.org/license/software. If the Alliance for Open
## Media Patent License 1.0 was not distributed with this source code in the
## PATENTS file, you can obtain it at www.aomedia.org/license/patent.
##
## This file tests aomenc using hantro_collage_w352h288.yuv as input. To add
## new tests to this file, do the following:
##   1. Write a shell function (this is your test).
##   2. Add the function to aomenc_tests (on a new line).
##
. $(dirname $0)/tools_common.sh

readonly TEST_FRAMES=10

# Environment check: Make sure input is available.
aomenc_verify_environment() {
  if [ ! -e "${YUV_RAW_INPUT}" ]; then
    elog "The file ${YUV_RAW_INPUT##*/} must exist in LIBAOM_TEST_DATA_PATH."
    return 1
  fi
  if [ "$(aomenc_can_encode_av1)" = "yes" ]; then
    if [ ! -e "${Y4M_NOSQ_PAR_INPUT}" ]; then
      elog "The file ${Y4M_NOSQ_PAR_INPUT##*/} must exist in"
      elog "LIBAOM_TEST_DATA_PATH."
      return 1
    fi
  fi
  if [ -z "$(aom_tool_path aomenc)" ]; then
    elog "aomenc not found. It must exist in LIBAOM_BIN_PATH or its parent."
    return 1
  fi
}

aomenc_can_encode_av1() {
  if [ "$(av1_encode_available)" = "yes" ]; then
    echo yes
  fi
}

aomenc_can_encode_av1() {
  if [ "$(av1_encode_available)" = "yes" ]; then
    echo yes
  fi
}

# Utilities that echo aomenc input file parameters.
y4m_input_non_square_par() {
  echo ""${Y4M_NOSQ_PAR_INPUT}""
}

y4m_input_720p() {
  echo ""${Y4M_720P_INPUT}""
}

# Echo default aomenc real time encoding params. $1 is the codec, which defaults
# to av1 if unspecified.
aomenc_rt_params() {
  local readonly codec="${1:-av1}"
  echo "--codec=${codec}
    --buf-initial-sz=500
    --buf-optimal-sz=600
    --buf-sz=1000
    --cpu-used=-6
    --end-usage=cbr
{'fraction_non_alphanumeric': 0.11908177905308465, 'fraction_numerical': 0.02702056432329029, 'mean_word_length': 3.531960996749729, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4067987', 'n_tokens_mistral': 1572, 'n_tokens_neox': 1468, 'n_words': 493}