Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[x265] Lossless option #515

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion avidemux_core/ADM_coreUtils/src/ADM_paramList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ static bool compressReadFromString(COMPRES_PARAMS *params,const char *str)
if(!strcasecmp(tmp,"2PASS")) {params->mode=COMPRESS_2PASS;params->finalsize=val;return true;}
if(!strcasecmp(tmp,"2PASSBITRATE")) {params->mode=COMPRESS_2PASS_BITRATE;params->avg_bitrate=val;return true;}
if(!strcasecmp(tmp,"AQ")) {params->mode=COMPRESS_AQ;params->qz=val;return true;}
if(!strcasecmp(tmp,"LOSSLESS")) {params->mode=COMPRESS_LOSSLESS;return true;}
ADM_error("Unknown mode :%s\n",tmp);
return false;

Expand All @@ -197,8 +198,9 @@ bool ADM_compressWriteToString(COMPRES_PARAMS *params, char **str)
case COMPRESS_SAME: sprintf(tmp,"SAME");break;
case COMPRESS_2PASS_BITRATE: sprintf(tmp,"2PASSBITRATE=%" PRIu32,params->avg_bitrate);break;
case COMPRESS_AQ: sprintf(tmp,"AQ=%" PRIu32,params->qz);break;
case COMPRESS_LOSSLESS: sprintf(tmp,"LOSSLESS=1");break;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me, it feels somewhat awkward to write "general.params=LOSSLESS=1" when "general.params=LOSSLESS=0" means exactly the same. Could you please explain the rationale?

With "general.params=LOSSLESS" we can exit compressReadFromString() early like in case of "general.params=SAME" (just not really used anywhere) and it is free from ambiguity, IMHO.

default:
ADM_error("Unknown compressin mode \n");
ADM_error("Unknown compression mode \n");
return false;
}
*str=ADM_strdup(tmp);
Expand Down