History

avcodec/dxva2(h264|mpeg2|vc1): use av_assert0 instead of assert

Tong Wu committed 2 years ago

Commit 270cd141 parent 0f015814 files · +12 −12Browse files

Unified · Split

4 files
  1. libavcodec/dxva2.c +2 −2
  2. libavcodec/dxva2_h264.c +8 −8
  3. libavcodec/dxva2_mpeg2.c +1 −1
  4. libavcodec/dxva2_vc1.c +1 −1
libavcodec/dxva2.c+2−2
@@ -20,10 +20,10 @@ · 19 unmodified lines
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */21 */
22 22
23#include <assert.h>
24#include <string.h>23#include <string.h>
25#include <initguid.h>24#include <initguid.h>
26 25
26#include "libavutil/avassert.h"
27#include "libavutil/common.h"27#include "libavutil/common.h"
28#include "libavutil/log.h"28#include "libavutil/log.h"
29#include "libavutil/time.h"29#include "libavutil/time.h"
@@ -1012,7 +1012,7 @@ int ff_dxva2_common_end_frame(AVCodecContext *avctx, AVFrame *frame, · 982 unmodified lines
1012 1012
1013 /* TODO Film Grain when possible */1013 /* TODO Film Grain when possible */
1014 1014
1015 assert(buffer_count == 1 + (qm_size > 0) + 2);1015 av_assert0(buffer_count == 1 + (qm_size > 0) + 2);
1016 1016
1017#if CONFIG_D3D11VA1017#if CONFIG_D3D11VA
1018 if (ff_dxva2_is_d3d11(avctx))1018 if (ff_dxva2_is_d3d11(avctx))
libavcodec/dxva2_h264.c+8−8
@@ -44,7 +44,7 @@ struct dxva2_picture_context { · 43 unmodified lines
44static void fill_picture_entry(DXVA_PicEntry_H264 *pic,44static void fill_picture_entry(DXVA_PicEntry_H264 *pic,
45 unsigned index, unsigned flag)45 unsigned index, unsigned flag)
46{46{
47 assert((index&0x7f) == index && (flag&0x01) == flag);47 av_assert0((index&0x7f) == index && (flag&0x01) == flag);
48 pic->bPicEntry = index | (flag << 7);48 pic->bPicEntry = index | (flag << 7);
49}49}
50 50
@@ -194,8 +194,8 @@ void ff_dxva2_h264_fill_scaling_lists(const AVCodecContext *avctx, AVDXVAContext · 143 unmodified lines
194 194
195static int is_slice_short(const AVCodecContext *avctx, AVDXVAContext *ctx)195static int is_slice_short(const AVCodecContext *avctx, AVDXVAContext *ctx)
196{196{
197 assert(DXVA_CONTEXT_CFG_BITSTREAM(avctx, ctx) == 1 ||197 av_assert0(DXVA_CONTEXT_CFG_BITSTREAM(avctx, ctx) == 1 ||
198 DXVA_CONTEXT_CFG_BITSTREAM(avctx, ctx) == 2);198 DXVA_CONTEXT_CFG_BITSTREAM(avctx, ctx) == 2);
199 return DXVA_CONTEXT_CFG_BITSTREAM(avctx, ctx) == 2;199 return DXVA_CONTEXT_CFG_BITSTREAM(avctx, ctx) == 2;
200}200}
201 201
@@ -348,10 +348,10 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, · 146 unmodified lines
348 static const unsigned start_code_size = sizeof(start_code);348 static const unsigned start_code_size = sizeof(start_code);
349 unsigned position, size;349 unsigned position, size;
350 350
351 assert(offsetof(DXVA_Slice_H264_Short, BSNALunitDataLocation) ==351 av_assert0(offsetof(DXVA_Slice_H264_Short, BSNALunitDataLocation) ==
352 offsetof(DXVA_Slice_H264_Long, BSNALunitDataLocation));352 offsetof(DXVA_Slice_H264_Long, BSNALunitDataLocation));
353 assert(offsetof(DXVA_Slice_H264_Short, SliceBytesInBuffer) ==353 av_assert0(offsetof(DXVA_Slice_H264_Short, SliceBytesInBuffer) ==
354 offsetof(DXVA_Slice_H264_Long, SliceBytesInBuffer));354 offsetof(DXVA_Slice_H264_Long, SliceBytesInBuffer));
355 355
356 if (is_slice_short(avctx, ctx))356 if (is_slice_short(avctx, ctx))
357 slice = &ctx_pic->slice_short[i];357 slice = &ctx_pic->slice_short[i];
@@ -453,7 +453,7 @@ static int dxva2_h264_start_frame(AVCodecContext *avctx, · 95 unmodified lines
453 453
454 if (!DXVA_CONTEXT_VALID(avctx, ctx))454 if (!DXVA_CONTEXT_VALID(avctx, ctx))
455 return -1;455 return -1;
456 assert(ctx_pic);456 av_assert0(ctx_pic);
457 457
458 /* Fill up DXVA_PicParams_H264 */458 /* Fill up DXVA_PicParams_H264 */
459 ff_dxva2_h264_fill_picture_parameters(avctx, ctx, &ctx_pic->pp);459 ff_dxva2_h264_fill_picture_parameters(avctx, ctx, &ctx_pic->pp);
libavcodec/dxva2_mpeg2.c+1−1
@@ -264,7 +264,7 @@ static int dxva2_mpeg2_start_frame(AVCodecContext *avctx, · 263 unmodified lines
264 264
265 if (!DXVA_CONTEXT_VALID(avctx, ctx))265 if (!DXVA_CONTEXT_VALID(avctx, ctx))
266 return -1;266 return -1;
267 assert(ctx_pic);267 av_assert0(ctx_pic);
268 268
269 ff_dxva2_mpeg2_fill_picture_parameters(avctx, ctx, &ctx_pic->pp);269 ff_dxva2_mpeg2_fill_picture_parameters(avctx, ctx, &ctx_pic->pp);
270 ff_dxva2_mpeg2_fill_quantization_matrices(avctx, ctx, &ctx_pic->qm);270 ff_dxva2_mpeg2_fill_quantization_matrices(avctx, ctx, &ctx_pic->qm);
libavcodec/dxva2_vc1.c+1−1
@@ -321,7 +321,7 @@ static int dxva2_vc1_start_frame(AVCodecContext *avctx, · 320 unmodified lines
321 321
322 if (!DXVA_CONTEXT_VALID(avctx, ctx))322 if (!DXVA_CONTEXT_VALID(avctx, ctx))
323 return -1;323 return -1;
324 assert(ctx_pic);324 av_assert0(ctx_pic);
325 325
326 ff_dxva2_vc1_fill_picture_parameters(avctx, ctx, &ctx_pic->pp);326 ff_dxva2_vc1_fill_picture_parameters(avctx, ctx, &ctx_pic->pp);
327 327

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t