Skip to content

Instantly share code, notes, and snippets.

@master-of-zen
master-of-zen / Sort function
Last active October 6, 2019 16:28
Book Sort for BookDonkeyBot
def sort_books(all_books, booktup) -> list:
# Remove books that not match language or extension
valid_books = all_books
if booktup.lang:
for book in list(all_books):
if book[2].lower() != booktup.lang.lower():
valid_books.remove(book)
if booktup.ext:
for book in list(all_books):
if book[4].lower() != booktup.ext.lower():
def search(booktup) -> list:
try:
# Scrap libgen search page for books data
logger.info(f'Searching for book: {booktup.title}')
all_books = []
for page in range(1, 10):
url = f'http://libgen.is/search.php?&{urlencode({"req": booktup.title, "res": 100, "page":page})}'
soup = BeautifulSoup(get(url).text, 'lxml')
books = soup.find_all('tr')[3:-1] # Get all books with their info
all_books.extend(extract_books(books))
import asyncio
from aiohttp import ClientSession
from urllib.parse import urlencode
async def fetch(url, session):
async with session.get(url) as response:
delay = response.headers.get("DELAY")
date = response.headers.get("DATE")
print("{}:{} with delay {}".format(date, response.url, delay))
# This patch created by @n9Mtq4 https://github.com/n9Mtq4
diff --git a/aom_dsp/noise_model.c b/aom_dsp/noise_model.c
index c7a0003a8..9d0c4ca75 100644
--- a/aom_dsp/noise_model.c
+++ b/aom_dsp/noise_model.c
@@ -1643,12 +1643,15 @@ int aom_denoise_and_model_run(struct aom_denoise_and_model_t *ctx,
if (!film_grain->random_seed) {
film_grain->random_seed = 7391;
}
+#if !CONFIG_DENOISE_NOISE_NO_APPLY

rav1e --rdo-lookahead-frames

Motivation:

Make fastest speed setting even faster with reasonable trade-off

Benchmarks:

Default lookahead value: 40

Speed: 10 | lookahead value | time diff | bd-rate diff | AWCY link |

rav1e --rdo-lookahead-frames research

Motivation:

Make speed settings faster with reasonable trade-off on different rdo-lookahead-frames values and suggest new defaults for each speed

Encoding speed difference

BD-rate difference

#!/usr/bin/env python
from matplotlib import pyplot as plt
import matplotlib
matplotlib.rc('xtick', labelsize=24)
matplotlib.rc('ytick', labelsize=24)
data = {
10: {
#!/usr/bin/env python
from matplotlib import pyplot as plt
import matplotlib
matplotlib.rc('xtick', labelsize=24)
matplotlib.rc('ytick', labelsize=24)
data = {
10: {

Main changes

  • Y plane downscaling before comparison
  • Frame buffer for keeping scaled frames as long as they required

2160p

Old