BaseTools: Fix BrotliCompress tool issue

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2946

This is the regression issue in BaseTools BrotliCompress after Brotli
is changed to submodule. BrotliCompress should store the source size
and scratch buffer size into the header of the compressed binary data.
But now, BrotliCompress doesn't store them. So, BrotliDecompress
can't work.

To fix this issue, BrotliCompress tool main() function should be provided.
It needs to support the options of -e, -d, -o file, -g gap, -q level.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Yunhua Feng <fengyunhua@byosoft.com.cn>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
This commit is contained in:
Yunhua Feng
2020-11-10 10:41:08 +08:00
committed by mergify[bot]
parent 4eea8f0136
commit 662b42db76
4 changed files with 576 additions and 59 deletions

View File

@@ -1,55 +0,0 @@
@REM @file
@REM This script will exec Brotli tool with -e/-d options.
@REM
@REM Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>
@REM SPDX-License-Identifier: BSD-2-Clause-Patent
@REM
@echo off
@setlocal
set QLT=-q 9 -w 22
set ARGS=
:Begin
if "%1"=="" goto End
if "%1"=="-d" (
set ARGS=%ARGS% %1
shift
goto Begin
)
if "%1"=="-e" (
shift
goto Begin
)
if "%1"=="-g" (
set ARGS=%ARGS% %1 %2
shift
shift
goto Begin
)
if "%1"=="-o" (
set ARGS=%ARGS% %1 %2
shift
shift
goto Begin
)
if "%1"=="-q" (
set QLT=%1 %2
shift
shift
goto Begin
)
set ARGS=%ARGS% %1
shift
goto Begin
:End
Brotli %QLT% %ARGS%
@echo on