Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Linux/drivers/media/platform/verisilicon/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 1 kB image not shown  

Quelle  hantro_mpeg2.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0
/*
 * Hantro VPU codec driver
 *
 * Copyright (C) 2018 Rockchip Electronics Co., Ltd.
 */


#include "hantro.h"

static const u8 zigzag[64] = {
 0,   1,  8, 16,  9,  2,  3, 10,
 17, 24, 32, 25, 18, 11,  4,  5,
 12, 19, 26, 33, 40, 48, 41, 34,
 27, 20, 13,  6,  7, 14, 21, 28,
 35, 42, 49, 56, 57, 50, 43, 36,
 29, 22, 15, 23, 30, 37, 44, 51,
 58, 59, 52, 45, 38, 31, 39, 46,
 53, 60, 61, 54, 47, 55, 62, 63
};

void hantro_mpeg2_dec_copy_qtable(u8 *qtable,
      const struct v4l2_ctrl_mpeg2_quantisation *ctrl)
{
 int i, n;

 if (!qtable || !ctrl)
  return;

 for (i = 0; i < ARRAY_SIZE(zigzag); i++) {
  n = zigzag[i];
  qtable[n + 0] = ctrl->intra_quantiser_matrix[i];
  qtable[n + 64] = ctrl->non_intra_quantiser_matrix[i];
  qtable[n + 128] = ctrl->chroma_intra_quantiser_matrix[i];
  qtable[n + 192] = ctrl->chroma_non_intra_quantiser_matrix[i];
 }
}

int hantro_mpeg2_dec_init(struct hantro_ctx *ctx)
{
 struct hantro_dev *vpu = ctx->dev;

 ctx->mpeg2_dec.qtable.size = ARRAY_SIZE(zigzag) * 4;
 ctx->mpeg2_dec.qtable.cpu =
  dma_alloc_coherent(vpu->dev,
       ctx->mpeg2_dec.qtable.size,
       &ctx->mpeg2_dec.qtable.dma,
       GFP_KERNEL);
 if (!ctx->mpeg2_dec.qtable.cpu)
  return -ENOMEM;
 return 0;
}

void hantro_mpeg2_dec_exit(struct hantro_ctx *ctx)
{
 struct hantro_dev *vpu = ctx->dev;

 dma_free_coherent(vpu->dev,
     ctx->mpeg2_dec.qtable.size,
     ctx->mpeg2_dec.qtable.cpu,
     ctx->mpeg2_dec.qtable.dma);
}

Messung V0.5
C=97 H=90 G=93

¤ Dauer der Verarbeitung: 0.16 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.